Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Array.from() vs slice.call()
(version: 1)
Comparing performance of:
Array.from vs Array.prototype.slice.call
Created:
4 days ago
by:
Guest
Go to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
/*your preparation JavaScript code goes here To execute async code during the script preparation, wrap it as function globalMeasureThatScriptPrepareFunction, example:*/ async function globalMeasureThatScriptPrepareFunction() { // This function is optional, feel free to remove it. // await someThing(); }
Tests:
Array.from
const params = [ "hello", true, 7, { first: "first", second: "second" } ] const other = Array.from(params);
Array.prototype.slice.call
const params = [ "hello", true, 7, { first: "first", second: "second" } ] const other = Array.prototype.slice.call(params);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Array.from
Array.prototype.slice.call
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
4 days ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/151.0.0.0 Safari/537.36
Browser/OS:
Chrome 151 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Array.from
77.2M/s
Array.prototype.slice.call
62.7M/s
View exact numbers
Test name
Executions per second
✓
Array.from
77,222,424 Ops/sec
Array.prototype.slice.call
62,658,476 Ops/sec
Related benchmarks
reate array by lenght
Pushing
how to get last array element
Array.from length vs Array
(Fixed) Array.from length vs Array
(Small Array.from length vs Array
Array length to string 1
Array.from length vs for loop
Array fill vs new Array(number)
Comments
Confirm delete:
Do you really want to delete benchmark?