Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The NaN value is defined to be unequal to everything, including itself. Test if a value is NaN with the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isNaN" rel="nofollow noreferrer"><code>isNaN()</code></a> function, appropriately enough. (ECMAScript 6 adds a <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN" rel="nofollow noreferrer"><code>Number.isNan()</code></a> function with different semantics for non-number arguments, but it's not supported in all browsers yet as of 2015).</p> <p>There are two built-in properties available with a NaN value: the global <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN" rel="nofollow noreferrer"><code>NaN</code></a> property (i.e. <code>window.NaN</code> in browsers), and <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN" rel="nofollow noreferrer"><code>Number.NaN</code></a>. It is <em>not</em> a language keyword. In older browsers, the <code>NaN</code> property could be overwritten, with potentially confusing results, but with the <a href="http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.1.1" rel="nofollow noreferrer">ECMAScript 5 standard it was made non-writable</a>.</p> <ul> <li>As @some pointed out in the comments, there is also the global function <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isFinite" rel="nofollow noreferrer">isFinite()</a> which may be useful.</li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload