Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
push vs spread reduce
(version: 0)
Comparing performance of:
push vs spread
Created:
2 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var arr = Array(100000000).fill(null)
Tests:
push
arr.reduce((acc, item, index) => { if (index % 10) return acc acc.push(index) return acc }, [])
spread
arr.reduce((acc, item, index) => { if (index % 10) return acc return [...acc, index] }, [])
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
push
spread
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Comments
Confirm delete:
Do you really want to delete benchmark?