Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
Chrome 129
Linux
Desktop
one year ago
Benchmark.js
Array.prototype.reduce.call()
55K/s
Array.prototype.forEach.call()
50K/s
Conventional for loop
47K/s
View exact numbers
Test name Executions per second
Array.prototype.reduce.call() 55,167 Ops/sec
Array.prototype.forEach.call() 50,100 Ops/sec
Conventional for loop 47,123 Ops/sec
Script Preparation code:
Tests: