Skip to content

Instantly share code, notes, and snippets.

@easierbycode
Created April 29, 2016 20:30
Show Gist options
  • Save easierbycode/0e61ccc06ae536086531b1aec7514d0a to your computer and use it in GitHub Desktop.
Save easierbycode/0e61ccc06ae536086531b1aec7514d0a to your computer and use it in GitHub Desktop.
can be used to replace '==='. fixes some ES5 issues.
let notNum = NaN;
console.log( notNum === notNum );
// false
console.log( Object.is(notNum, notNum) )
// true
let amt = 0, total = -0;
console.log( amt === total )
// true
console.log( Object.is(amt, total) );
// false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment