Math.max with apply vs spread vs reduce on object array
Compare the new ES6 spread operator with the Math.max.apply method
2 months ago
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
Test name |
Executions per second |
Max with apply |
1313.3 Ops/sec |
Max with spread operator |
1325.1 Ops/sec |
Reduce |
439.0 Ops/sec |
Tests:
-
Max with apply
-
Max with spread operator
-
Reduce
Open this result on MeasureThat.net