Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
for vs for..of vs forEach, arrow function
(version: 0)
Comparing performance of:
for native vs for vs forEach vs some vs for .. of
Created:
4 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var array = new Array(1000);
Tests:
for native
for (let i = array.length - 1; i >= 0; i--) { array[i]; }
for
for (let i = 0; i < array.length; i++) { array[i]; }
forEach
array.forEach((x) => x);
some
array.some((x) => false);
for .. of
for (let i of array) { array[i]; }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (5)
Previous results
Fork
Test case name
Result
for native
for
forEach
some
for .. of
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:
foreach vs for..of
foreach vs for...of
for of vs forEach with console log
For loop vs <Array>.forEach() vs for...of loop
forEach vs for of 7
Comments
Confirm delete:
Do you really want to delete benchmark?