Check isArray

JavaScript performance comparison

Test case created by Roland

Preparation code


      
      <script>
Benchmark.prototype.setup = function() {
  var arr = ["tada", "pula"];

};
</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
isArray
Array.isArray(arr);
pending…
typeof and instance
typeof arr === "array" || arr instanceof Array;
pending…
toString
Object.prototype.toString.call(arr) === '[object Array]';
pending…
typeof
typeof arr === "array";
pending…
instanceof
arr instanceof Array;
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