Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
For loop vs For...Of loop 2
(version: 0)
Comparing performance of:
for loop vs for...of loop
Created:
6 years ago
by:
Guest
Jump to the latest result
Tests:
for loop
let operation = [{foo: {bar: 'bar'}},{foo: {bar: 'bar'}},{foo: {bar: 'bar'}},{foo: {bar: 'bar'}}]; for (let i=0; i<operation.length; i++) { if (operation[i].foo && operation[i].foo.bar) { console.log(operation[i].foo.bar); } }
for...of loop
let operation = [{foo: {bar: 'bar'}},{foo: {bar: 'bar'}},{foo: {bar: 'bar'}},{foo: {bar: 'bar'}}]; for(let value of operation){ if (value.foo && value.foo.bar) { console.log(value.foo.bar); } }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
for loop
for...of loop
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:
pow vs for-loop
foreach vs for vs for in
foreach vs for..of
djkencioemzio foreach vs for loop
For loop vs <Array>.forEach() vs for...of loop
Comments
Confirm delete:
Do you really want to delete benchmark?