isArray

Benchmark created by pid on


Preparation HTML

<script src="http://cdnjs.cloudflare.com/ajax/libs/lodash.js/0.4.2/lodash.min.js"></script>

Setup

var arr = ["a", "b", "c"];
    var str = '["a", "b", "c"]';

Test runner

Ready to run.

Testing in
TestOps/sec
Kriesinger
Object.prototype.toString.call(arr) == '[object Array]';
Object.prototype.toString.call(str) == '[object Array]';
ready
lodash
_.isArray(arr) == true;
_.isArray(str) == true;
ready
lodash implementation
toString.call(arr) == '[object Array]';
toString.call(str) == '[object Array]';
 
ready
native isArray
Array.isArray(arr);
Array.isArray(str);
 
ready

Revisions

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