Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Add new element to array: push vs destructuring with Set
spread operator vs Push
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Android 13; Mobile; rv:122.0) Gecko/122.0 Firefox/122.0
Browser:
Firefox Mobile 122
Operating system:
Android
Device Platform:
Mobile
Date tested:
2 years ago
Test name
Executions per second
spread operator
757006.4 Ops/sec
push
849993.4 Ops/sec
Tests:
spread operator
var params = [ "hello", true, 7, 'new' ] var other = [...new Set([ ...params, 'new' ])]
push
var params = [ "hello", true, 7, 'new' ] params.push('new') var other = [...new Set(params)]