isnan parsefloat vs typeof-number

Benchmark created on


Preparation HTML

<script>
  var a = Math.random()*10;
  var b = a;
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
isNan
var c = !isNaN( parseFloat( a ) ) && isFinite(a);
ready
typeof number
var d = (typeof( b ) === "number") && isFinite(b);
ready

Revisions

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