Skip to content

Instantly share code, notes, and snippets.

@motss
Last active July 12, 2019 09:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save motss/1da9cbea50a9b6966be820b231df13c4 to your computer and use it in GitHub Desktop.
Save motss/1da9cbea50a9b6966be820b231df13c4 to your computer and use it in GitHub Desktop.
According to ECMAScript's specs, it explains why null == undefined
// http://www.ecma-international.org/ecma-262/5.1/#sec-11.9.3
// http://es5.github.io/#x11.9.3
// Abstract/ loose equality comparison will do type coercion
// While strict equality comparison will compare the types
null == undefined; // true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment