JS isArray Comparison (v3)

Revision 3 of this benchmark created on


Setup

var a = ["word1","more words"];

Test runner

Ready to run.

Testing in
TestOps/sec
Object.prototype.toString
Object.prototype.toString.call(a) === '[object Array]';
ready
Array.isArray
Array.isArray(a);
ready
instanceof
a instanceof Array
ready
.constructor === Array
a.constructor === Array
ready

Revisions

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