new array vs spread operator (v5)

Revision 5 of this benchmark created on


Setup

const initialArray = [];
for (let x = 0; x < 100000; x++) {
	initialArray.push(x);
}
const initialSet = new Set(initialArray);

Test runner

Ready to run.

Testing in
TestOps/sec
array iteration
for (let i = 0; i < initialArray.length; i++) {

}
ready
array iteration of
for (const value of initialArray) {

}
ready
array forEach
initialArray.forEach((value) => {
	
})
ready

Revisions

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