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