Check isArray (v2)

Revision 2 of this benchmark created on


Setup

var arr = ["tada", "pula"];

Test runner

Ready to run.

Testing in
TestOps/sec
isArray
Array.isArray(arr);
ready
typeof and instance
typeof arr === "array" || arr instanceof Array;
ready
toString
Object.prototype.toString.call(arr) === '[object Array]';
ready
typeof
typeof arr === "array";
ready
instanceof
arr instanceof Array;
ready
isArray
arr.constructor === Array;
ready

Revisions

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