This question already has an answer here:(这个问题已经在这里有了答案:)
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
2.1m questions
2.1m answers
60 comments
57.0k users