Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
for loop vs array.forEach - on regular looping use
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Mobile Safari/537.36 EdgA/130.0.0.0
Browser:
Chrome Mobile 130
Operating system:
Android
Device Platform:
Mobile
Date tested:
one year ago
Test name
Executions per second
for loop
47.0 Ops/sec
array.forEach
46.7 Ops/sec
Tests:
for loop
for (let i = 1; i <= 1000; i++) { console.log(i); }
array.forEach
[...Array(1000)].forEach((val,i,arr) => console.log(i+1));