gla*_*snt 60
'==='表示没有类型coersion的平等.换句话说,如果使用三等于,则值的类型也必须相等.
例如
0==false // true
0===false // false, because they are of a different type
1=="1" // true, auto type coersion
1==="1" // false, because they are of a different type
Run Code Online (Sandbox Code Playgroud)
资料来源:http://longgoldenears.blogspot.com/2007/09/triple-equals-in-javascript.html
Kei*_*gan 16
从我的博客中删除:keithdonegan.com
平等算子(==)
等于运算符(==)检查两个操作数是否相同,如果它们相同则返回true,如果它们不同则返回false.
身份运营商(===)
身份运算符检查两个操作数是否"相同".
这些规则确定两个值是否相同: