Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Javascript string to array mapping: Array.from() vs Spread syntax [...spread] vs split
(version: 1)
Comparing performance of:
Array.from vs [...spread] vs split
Created:
one year ago
by:
Guest
Jump to the latest result
Script Preparation code:
var string = '1'.repeat(1000);
Tests:
Array.from
const array = Array.from(string);
[...spread]
const array = [...string];
split
const array = string.split('');
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
Array.from
[...spread]
split
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:138.0) Gecko/20100101 Firefox/138.0
Browser/OS:
Firefox 138 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Array.from
201205.8 Ops/sec
[...spread]
206484.9 Ops/sec
split
960784.1 Ops/sec
Related benchmarks:
spread vs slice vs splice
Array.from vs Spread with undefined and map
Splice vs Spread to insert at beginning of array
Javascript string to array mapping: Array.from() vs Spread syntax [...spread]
Array.from vs Spread for strings
Simple array spread vs array push
Array.from() vs spread []
spread vs ArrayFrom
toSpliced vs Spread
Comments
Confirm delete:
Do you really want to delete benchmark?