Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Chrome 131
Linux
Desktop
one year ago
Benchmark.js
filter with a map
23K/s
loop with push
12K/s
reduce with push
9K/s
flatMap
6K/s
View exact numbers
Test name Executions per second
filter with a map 23,072 Ops/sec
loop with push 12,429 Ops/sec
reduce with push 9,052 Ops/sec
flatMap 6,093 Ops/sec
Script Preparation code:
Tests: