Array.isArray vs instanceof Array vs _.isArray vs Ext.isArray (v15)

Revision 15 of this benchmark created on


Preparation HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.7.0/lodash.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/extjs/4.2.1/bootstrap.js"></script>

Setup

var a = [1, 2, 3];
    var s = 'example';
    var f = false;

Test runner

Ready to run.

Testing in
TestOps/sec
Array.isArray
(Array.isArray(a) && (Array.isArray(s) || Array.isArray(f)));
ready
instanceof
(a instanceof Array && (s instanceof Array || f instanceof Array));
ready
_.isArray
_.isArray(a) && (_.isArray(s) || _.isArray(f));
ready
Ext.isArray
Ext.isArray(a) && (Ext.isArray(s) || Ext.isArray(f));
ready

Revisions

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