Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
copy an array 3232
(version: 1)
Comparing performance of:
spread vs from vs concat array vs slice
Created:
4 years ago
by:
Registered User
Jump to the latest result
Script Preparation code:
var arr = [{name:'a', age:2}, {name:'b', age:23}, {name:'c', age:22}]
Tests:
spread
arr2 = [...arr]
from
arr2 = Array.from(arr)
concat array
arr2 = [].concat(arr)
slice
arr2 = arr.slice(0)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
spread
from
concat array
slice
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!
Related benchmarks:
array to obj by key value
array to obj by key value advanced
array find vs object key search
jsTest
const in a for loop
Comments
Confirm delete:
Do you really want to delete benchmark?