Skip to content

Instantly share code, notes, and snippets.

@djD-REK
Created September 15, 2019 15:45
Show Gist options
  • Save djD-REK/54a0e6ada5da133c7fbf53d0075b53e9 to your computer and use it in GitHub Desktop.
Save djD-REK/54a0e6ada5da133c7fbf53d0075b53e9 to your computer and use it in GitHub Desktop.
let variable = NaN; // or let variable = Number.NaN
// Check for NaN by checking for self-equality
console.log(variable != variable); // true
console.log(variable !== variable); // true
// NaN is the only value that is not equal to itself
let isNaN = (maybeNaN) => maybeNaN!=maybeNaN;
console.log(isNaN(variable)); // true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment