阅读背景:

为什么if(“string”)将“string”评估为true,但if(“string”== true)不是?

来源:互联网 

Given the following code:

给出以下代码:

if ("string") {
    console.log('true!');
}
//logs "true" to the console
if ("string"==true) {
    console.log('true!');
}
//doesn't log anything
if ("stri



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: