JavaScript syntax: Difference between revisions

Content deleted Content added
Line 310:
alert(false == "" ); // true.... false → 0 === 0 ← ""
alert(false == NaN); // false... false → 0 !== NaN
 
alert(NaN == NaN); // false...... NaN is not equivalent to anything, including NaN.
 
//Type checked comparison (no conversion of types and values)
alert(true === 1); // false...... data types do not match
 
//Explicit type coercion