how to handle nan in javascript code example
Example 1: javascript check if is nan
function isNaN(x) {
return x !== x;
};
isNaN(NaN);//true
Example 2: javascript nan
NaN = Not a number.
Example 3: nan in js
var val = Number.NaN;
function isNaN(x) {
return x !== x;
};
isNaN(NaN);//true
NaN = Not a number.
var val = Number.NaN;