Jeremy Vinding

Blogging for me, not for you!

javascript

true or false

No Comments

The interesting comparisons from Douglas Crockford’s book when he’s recommending “===” instead of “==”:

'' == '0'          // false
0 == ''            // true
0 == '0'           // true

false == 'false'   // false
false == '0'       // true

false == undefined // false
false == null      // false
null == undefined  // true

' \t\r\n ' == 0    // true

Unless otherwise noted, all content on this site is licensed under a Creative Commons by-nc-nd 3.0 License.