Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

difference between == and === in javascript

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
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #difference #javascript
ADD COMMENT
Topic
Name
2+2 =