Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Alternate Array.isArray vs instanceof with extra nonsense
(version: 0)
Comparing performance of:
Instanceof if vs isArray if vs Length if vs Length if undef vs Map if vs Ctor check
Created:
3 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var c = 0, a = Array(10).fill().map((el,i) => i);var c = 0, a = Array(10).fill().map((el,i) => i);
Tests:
Instanceof if
if(a instanceof Array) ++c;
isArray if
if(Array.isArray(a)) ++c;
Length if
if(a.length > -1) ++c;
Length if undef
if(a.length !== undefined) ++c;
Map if
if(a.map) ++c;
Ctor check
if(a.constructor === Array) ++c;
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (6)
Previous results
Fork
Test case name
Result
Instanceof if
isArray if
Length if
Length if undef
Map if
Ctor check
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Related benchmarks:
Array isArray vs instanceof
Array isArray vs instanceof 2
Array.from() vs new Array() performance...
Alternate Array.isArray vs instanceof with nonsense
Comments
Confirm delete:
Do you really want to delete benchmark?