Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
For with variable 2
(version: 0)
Comparing performance of:
1 vs 2
Created:
3 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
window.arr = Array.from({ length: 10000 }, (_, i) => i)
Tests:
1
for (let i = 0; i < arr.length; i++) { console.log(i); }
2
for (let i = 0, maxLength = arr.length; i < maxLength; i++) { console.log(i) }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
1
2
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: get last item
For with variable
set vs some 1000000
For Loop Leng Inside and Outside
Comments
Confirm delete:
Do you really want to delete benchmark?