Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Javascript slice, splice, pop, unshift
(version: 0)
Comparing performance of:
slice vs splice vs pop vs unshift
Created:
4 years ago
by:
Guest
Jump to the latest result
Tests:
slice
const rainbow = ['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet']; const sliced = rainbow.slice(4,1)
splice
const rainbow = ['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet']; const spliced = rainbow.splice(4,1)
pop
const rainbow = ['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet']; const popped = rainbow.pop()
unshift
const rainbow = ['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet']; const unshifted = rainbow.unshift()
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
slice
splice
pop
unshift
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:
Slice vs Splice delete
Slice vs Splice delete 1000
Slice vs splice forked
Slice vs splice 2 ...
Splice Slice 80
Comments
Confirm delete:
Do you really want to delete benchmark?