Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
ForOf vs Map
(version: 0)
Comparing performance of:
ForOf vs Map
Created:
one year ago
by:
Guest
Jump to the latest result
Script Preparation code:
var arr = Array(10_000).fill({apple:55})
Tests:
ForOf
const newArr = [] for(const el of arr){ el.apple = 4 newArr.push(el) }
Map
const newArr = arr.map(el => el.apple = 4)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
ForOf
Map
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
Browser/OS:
Chrome 129 on Linux
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
ForOf
37752.5 Ops/sec
Map
42730.9 Ops/sec
Related benchmarks:
For loop map vs map builtin for 10000000 elements
For loop map vs map builtin for 100000 elements
Array for vs. map push
for vs map to fill array
for vs map to fill array fixed
fill vs map
fill vs for loop
For + Push vs Map
for of vs map with object
Comments
Confirm delete:
Do you really want to delete benchmark?