Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
for of vs filter().map()
(version: 1)
for of vs filter map
Comparing performance of:
filter().map() vs for of
Created:
10 months ago
by:
Guest
Jump to the latest result
Script Preparation code:
var arr = []; var i = 0; while (i <= 1E5) arr[i] = i++;
Tests:
filter().map()
arr.filter(x => x % 3).map(x => x/100)
for of
let result = []; for (const x of result) { if (x % 3) { result.push(x/100); } }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
filter().map()
for of
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
10 months ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36
Browser/OS:
Chrome 138 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
filter().map()
541.7 Ops/sec
for of
171837488.0 Ops/sec
Related benchmarks:
Reduce vs Filter/Map vs Map/Filter
flatMap() vs filter().map() vs for loop accumulator
if push vs filter map
filter with forEach vs for with if
flatMap() vs filter().map() vs for..of
Filtering + Mapping
Map vs Filter
flatMap() vs filter().map() vs for loop accumulator vs forEach
flatMap() vs filter().map() vs for loop accumulator vs forEach vs for of loop
Comments
Confirm delete:
Do you really want to delete benchmark?