JS isArray Comparison (v7)

Revision 7 of this benchmark created by Dom on


Setup

var a = [];

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.