Math.max with apply vs spread vs reduce on object array
Compare the new ES6 spread operator with the Math.max.apply method
3 months ago
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
Test name |
Executions per second |
Max with apply |
1111.7 Ops/sec |
Max with spread operator |
1195.0 Ops/sec |
Reduce |
278.5 Ops/sec |
Tests:
-
Max with apply
-
Max with spread operator
-
Reduce
Open this result on MeasureThat.net