Every isNaN (v2)

Revision 2 of this benchmark created by Bemi Faison on


Description

This test is meant to consolidate several isNaN techniques. Please update with any isNaN alternatives you know, and test on every possible JavaScript agent.

Setup

x = "str";
    y = 43;

Test runner

Ready to run.

Testing in
TestOps/sec
isNaN function
if(isNaN(x));
if(isNaN(y));
ready
"" + NaN
if(x+"" === "NaN");
if(y+"" === "NaN");
ready
+NaN
if(+x !== NaN);
if(+y !== NaN);
ready
<= && >
if (!(x <= 0) && !(x > 0));
if (!(y <= 0) && !(y > 0));
ready
<= || >
if (x <= 0 || x > 0);
if (y <= 0 || y > 0);
ready
typeof
if (typeof x === 'number');
if (typeof y === 'number');
 
ready
~~a === a
if (~~x === x);
if (~~y === y);
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.