Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
slice() vs slice(0)
(version: 1)
Comparing performance of:
slice() vs slice(0)
Created:
2 months ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
const ARRAY = Array.from({ length: 10_000 }, (_, i) => i)
Tests:
slice()
ARRAY.slice()
slice(0)
ARRAY.slice(0)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
slice()
slice(0)
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
2 months ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36
Browser/OS:
Chrome 143 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
slice()
1809504.6 Ops/sec
slice(0)
2122286.0 Ops/sec
Related benchmarks:
`Array.slice(-1)[0]` vs `Array[Array.length]`
`Array.slice(-1)[0]` vs `Array[Array.length]` for 10000 length
slice vs get by index
slice vs length-1
Array.from or slice
Array.prototype.slice vs spread op
Spread vs Slice in JS arrays
Slice vs Shift (for 1 element)
at(-1) vs slice(-1)[0] vs length - 1
Comments
Confirm delete:
Do you really want to delete benchmark?