Skip to content

Instantly share code, notes, and snippets.

@fakhrizaki
Last active August 29, 2015 14:17
Show Gist options
  • Save fakhrizaki/ecef0f29f695f88e4f18 to your computer and use it in GitHub Desktop.
Save fakhrizaki/ecef0f29f695f88e4f18 to your computer and use it in GitHub Desktop.
Strict Comparison in JS (== vs ===)
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
null == undefined // true
null === undefined // false
'0' == false // true
'0' === false // false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment