我知道在JavaScript中有两种方法可以检查变量是否不为null,但我对哪种方法是最佳实践感到困惑。
null
我应该使用哪种方式:
if (myVar) {...}
还是
if (myVar !== null) {...}
用户名或邮箱地址
密码