Tuesday, October 23, 2012

javascript three equals “===”

The 3 equal signs mean "equality without type coercion". Using the triple equals, the values must be equal in type as well.

0==false   // true
0===false  // false, because they are of a different type
1=="1"     // true, auto type coercion
1==="1"    // false, because they are of a different type


http://stackoverflow.com/questions/523643/difference-between-and-in-javascript

No comments:

Post a Comment