Array.from vs Spread (v2)

Revision 2 of this benchmark created on


Setup

window.mySet = new Set();
for (let i = 0; i < 1000000; i++) {
	window.mySet.add(i);
}

Test runner

Ready to run.

Testing in
TestOps/sec
Array.from
const newItem = Array.from(window.mySet);
ready
Spread
const mySet = [...window.mySet]
ready
lmao
const mySet = Array.from([...window.mySet])
ready

Revisions

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