Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
for loop vs. .map (6/17/2026)
(version: 1)
Comparing performance of:
.map vs for loop
Created:
3 days ago
by:
Guest
Jump to the latest result
Script Preparation code:
// Create sample data var array = [1,2,3,4,5,6,7,8,9,0]; var manipulateFn = num => { return num * 2 * 3; }
Tests:
.map
const newArray = array.map(i => manipulateFn(i));
for loop
const newArray = []; for (let index = 0; index < array.length; index++) { newArray.push(manipulateFn(array[index])); }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
.map
for loop
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
3 days ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:148.0) Gecko/20100101 Firefox/148.0
Browser/OS:
Firefox 148 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
.map
18693144.0 Ops/sec
for loop
10320423.0 Ops/sec
Comments
Confirm delete:
Do you really want to delete benchmark?