Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
.map() vs for-of + push
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:139.0) Gecko/20100101 Firefox/139.0
Browser:
Firefox 139
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
for-of + push
4037.7 Ops/sec
map
27602.4 Ops/sec
Script Preparation code:
var list = Array.from(new Array(10000)).map((_, i) => i) var result = []
Tests:
for-of + push
for (const value of list) { result.push(value * 2); }
map
result = list.map(v => v * 2);