Checking Array Type

Benchmark published by System on

Description

Array.isArray vs instanceof.

Setup

const arr = [];

Test Runner

Initializing...

Testing in
Test CaseOps/sec
Array.isArray()
Array.isArray(arr);
ready
instanceof Array
arr instanceof Array;
ready
Object.prototype.toString
Object.prototype.toString.call(arr) === '[object Array]';
ready

Revisions

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

Revision 1
publishedby Systemon