This question already has an answer here:
(这个问题已经在这里有了答案:)
(JavaScript比较中应使用哪个等于运算符(== vs ===)?)
(49个答案)
What is the difference between == and === in JavaScript?
==
===
(JavaScript中==和===什么区别?)
!=
!==
(我也看到过!=和!==运算符。)
(还有更多这样的运营商吗?)
Take a look here: http://longgoldenears.blogspot.com/2007/09/triple-equals-in-javascript.html
(在这里看看: http : //longgoldenears.blogspot.com/2007/09/triple-equals-in-javascript.html)
The 3 equal signs mean "equality without type coercion".
(3个等号表示“没有类型强制的平等”。)
(使用三重等于,值的类型也必须相等。)
0 == false // true 0 === false // false, because they are of a different type 1 == "1" // true, automatic type conversion for value only 1 === "1" // false, because they are of a different type null == undefined // true null === undefined // false '0' == false // true '0' === false // false
1.4m articles
1.4m replys
5 comments
56.8k users