阅读背景:

为什么在JavaScript中,alert(!! " 0 ")和alert(false = " 0 ")都输出为true

来源:互联网 

As far as I know in JavaScript !! is supposed to normalize a boolean value converting it to true or false from some other type. This would mean that the "0" converts to boolean true. On the other hand if I compare it with false it turns out that it is in fact false (as the result of the comparison is true). What rule am I missing here. I have tested it in IE and Opera.As far as I know in JavaScript !! is supposed t




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

分享到: