Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
array spread vs concat vs from vs slice
Compare various ways of copying an array
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36
Browser:
Chrome 135
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Array.prototype.concat
81250016.0 Ops/sec
Array.prototype.from
69523536.0 Ops/sec
Array.prototype.slice
103844488.0 Ops/sec
spread operator
72223480.0 Ops/sec
Tests:
Array.prototype.concat
const array = [1, 2] const newArray = array.concat()
Array.prototype.from
const array = [1, 2] const newArray = Array.from(array)
Array.prototype.slice
const array = [1, 2] const newArray = array.slice(0)
spread operator
const array = [1, 2] const newArray = [...array]