instanceof vs typeof

Benchmark created on


Preparation HTML

<script>
  function f() {
  
  }
  var x;
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
typeof
x = (typeof(f) === "function");
ready
instanceof
x = (f instanceof Function);
ready

Revisions

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