Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Add new element to array: push vs destructuring vs directly assign
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36
Browser:
Chrome 132
Operating system:
Chrome OS 14541.0.0
Device Platform:
Desktop
Date tested:
one year ago
Push
23.5M/s
Assign
21.3M/s
spread operator
15.4M/s
View exact numbers
Test name
Executions per second
✓
Push
23,479,402 Ops/sec
Assign
21,305,646 Ops/sec
spread operator
15,358,222 Ops/sec
Tests:
spread operator
var params = [ "hello", true, 7 ] params = [ ...params, 'new' ]
Push
var params = [ "hello", true, 7 ]; params.push('new');
Assign
var params = [ "hello", true, 7 ]; params[3] ='new';