Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Array.from vs native from vs array.of
(version: 1)
Comparing performance of:
Array.from vs native from vs Array.of
Created:
10 months ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
function a(ArrayLike, map, thisArg) { return 'length' in ArrayLike ? map ? [].map.call(ArrayLike, map, thisArg) : [].slice.call(ArrayLike) : map ? Array.from(ArrayLike, map, thisArg) : [...ArrayLike] } let b = Array.from let c = Array.of.apply.bind(Array.of,1) let arr = Array.from({length:1e3},(a,i)=>i), set = new Set(arr), generic = {length: 1e3}
Tests:
Array.from
b(arr) b(set) b(generic)
native from
a(arr) a(set) a(generic)
Array.of
c(arr) c(set) c(generic)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
Array.from
native from
Array.of
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!
Comments
Confirm delete:
Do you really want to delete benchmark?