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:
one month ago
by:
Guest
Go 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:
one month 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
.map
18.7M/s
for loop
10.3M/s
View exact numbers
Test name
Executions per second
✓
.map
18,693,144 Ops/sec
for loop
10,320,423 Ops/sec
Related benchmarks
for loop vs. .map
for loop vs. .map [2]
for loop vs. .map but fast
for loop vs. .map anon
for of loop vs. .map
for loop vs. .map with size
for in loop vs. .map
.map vs for loop
.map vs for loop vs for loop cached vs for of
Comments
Confirm delete:
Do you really want to delete benchmark?