Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
Chrome 120
Windows
Desktop
2 years ago
Benchmark.js
using Array.reduce()
12.9M/s
using Math.max() with spread operators
4.7M/s
View exact numbers
Test name Executions per second
using Array.reduce() 12,888,180 Ops/sec
using Math.max() with spread operators 4,658,350 Ops/sec
Script Preparation code:
Tests: