unshift or spread

Benchmark created on


Setup

var arr = [...Array(1000).keys()]

Test runner

Ready to run.

Testing in
TestOps/sec
insert at pos 0 using unshift
arr.unshift(777)
ready
insert at pos 0 using spread
arr = [777, ...arr]
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.