Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
array 1-100
(version: 0)
Comparing performance of:
for vs Object.keys vs Array.from
Created:
4 years ago
by:
Registered User
Jump to the latest result
Script Preparation code:
var len = 100;
Tests:
for
let arr = [] for(let i = 0; i < 100; i++) { arr.push(i) }
Object.keys
Object.keys(Array.apply(null, {length: len})).map(function(item){ return +item; })
Array.from
Array.from(Array(len), (v,k) => k+1)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
for
Object.keys
Array.from
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:
teststest
teststest1
for (reverse with length) vs for with small array
Pop vs length -1
Pop vs length -1 vs at -1
Comments
Confirm delete:
Do you really want to delete benchmark?