Every isNaN

JavaScript performance comparison

Revision 4 of this test case created by SiPlus

Preparation code


      
      <script>
Benchmark.prototype.setup = function() {
  x = "str";
  y = 43;

};
</script>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
isNaN function
if(isNaN(x));
if(isNaN(y));
pending…
"" + NaN
if(x+"" === "NaN");
if(y+"" === "NaN");
pending…
+NaN
if(+x !== NaN);
if(+y !== NaN);
pending…
<= && >
if (!(x <= 0) && !(x > 0));
if (!(y <= 0) && !(y > 0));
pending…
<= || >
if (x <= 0 || x > 0);
if (y <= 0 || y > 0);
pending…
typeof
if (typeof x === 'number');
if (typeof y === 'number');
pending…
~~a === a
if (~~x === x);
if (~~y === y);
pending…
a !== a
if (x !== x);
if (y !== y);
pending…
Number.isNaN function
if(Number.isNaN(x));
if(Number.isNaN(y));
pending…

Compare results of other browsers

Revisions

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

0 Comments