Clone array (10k) (v2)

Revision 2 of this benchmark created on


Setup

const size = 10000
const original = new Array(size)

for (let i = 0; i < size; i++) {
	original[i] = i
}

Test runner

Ready to run.

Testing in
TestOps/sec
Spread
const duplicate = [...original]
ready
Slice
const duplicate = original.slice()
ready
Array.from
const duplicate = Array.from(original)
ready

Revisions

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