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
Go 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
Map
43K/s
ForOf
38K/s
View exact numbers
Test name
Executions per second
✓
Map
42,731 Ops/sec
ForOf
37,752 Ops/sec
Related benchmarks
fill vs map
for of vs map with object
Comments
Confirm delete:
Do you really want to delete benchmark?