Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Performace For Types
(version: 0)
Comparing performance of:
For vs For of vs For in vs For each
Created:
5 years ago
by:
Guest
Jump to the latest result
Tests:
For
itemList = [0,1,2,3,4,5,6,7,8,9]; for(let index= 0; index<itemList.legth; index++){ const count = itemList[index]; };
For of
itemList = [0,1,2,3,4,5,6,7,8,9]; for(item of itemList){ const count = item; };
For in
itemList = [0,1,2,3,4,5,6,7,8,9]; for(item in itemList){ const count = item; };
For each
itemList = [0,1,2,3,4,5,6,7,8,9]; itemList.forEach(item => { const count = item; });
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
For
For of
For in
For each
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:
typeof vs typecast measuring
void vs typeof on ===
(instanceof Function) vs (typeof function)
typeof vs typeof isNaN
number vs typeof
Comments
Confirm delete:
Do you really want to delete benchmark?