how to check if a value is a nan in javascript code example Example: javascript check if is nan function isNaN(x) { return x !== x; }; isNaN(NaN);//true