Skip to content

Instantly share code, notes, and snippets.

@ryangreenberg
Created April 12, 2012 20:38
Show Gist options
  • Save ryangreenberg/2370820 to your computer and use it in GitHub Desktop.
Save ryangreenberg/2370820 to your computer and use it in GitHub Desktop.
val == val // false
[ undefined, null, [], {}, NaN ].forEach(function(val){
console.log("val =", val, "; val == val; //", val == val );
});
// Output
// val = undefined ; val == val; // true
// val = null ; val == val; // true
// val = [] ; val == val; // true
// val = {} ; val == val; // true
// val = NaN ; val == val; // false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment