Determine if a value is NaN (Not-a-Number) more reliably than the global isNaN().
Source Code
console.log(Number.isNaN(NaN)); // true
console.log(Number.isNaN(0 / 0)); // true
console.log(Number.isNaN("text" * 2)); // true
Determine if a value is NaN (Not-a-Number) more reliably than the global isNaN().
console.log(Number.isNaN(NaN)); // true
console.log(Number.isNaN(0 / 0)); // true
console.log(Number.isNaN("text" * 2)); // true