Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
for of vs for loops 4
(version: 2)
Comparing performance of:
for-of vs for-index
Created:
one year ago
by:
Registered User
Jump to the latest result
Script Preparation code:
const planes = new Array(50_000).fill(1000);
Tests:
for-of
for (const plane of planes) { const a = plane + plane; }
for-index
for (let i = 0; i < planes.length; i++) { const plane = planes[i]; const a = plane + plane; }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
for-of
for-index
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:137.0) Gecko/20100101 Firefox/137.0
Browser/OS:
Firefox 137 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
for-of
4232.4 Ops/sec
for-index
22246.0 Ops/sec
Related benchmarks:
for vs for of vs for in
for loops and stuff
JS array for test
for of vs for loops
for of vs for loops 10k
for of vs for loops 1k
for of vs for loops 2
for of vs for loops 3
for of vs for loops 5
Comments
Confirm delete:
Do you really want to delete benchmark?