isNaN vs typeof

Benchmark created by Martin Borthiry on


Preparation HTML

<script>
  var a = 123456789;
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
isNaN
var b = !isNaN(a);
ready
typeof
var b = typeof(a) === 'number';
ready

Revisions

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