Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
Array.prototype.slice vs spread operator (forked 2)
Compare the new ES6 spread operator with the traditional slice() method
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0
Browser:
Firefox 134
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Benchmark engine:
Benchmark.js
spread operator
12.8M/s
Array.prototype.slice Array.prototype.concat
9.1M/s
View exact numbers
Test name
Executions per second
✓
spread operator
12,826,432 Ops/sec
Array.prototype.slice Array.prototype.concat
9,074,098 Ops/sec
Tests:
Array.prototype.slice Array.prototype.concat
var params = [ "hello", true, 7 ]; var other = params.slice().concat([4, "world", false]);
spread operator
var params = [ "hello", true, 7 ] var other = [ ...params, 4, "world", false]