assign property

Benchmark created on


Setup

data = new Array(100).fill(1)
obj = {}

Test runner

Ready to run.

Testing in
TestOps/sec
assign
data.forEach((d, i) => {
	obj[i] = d
})
ready
spread
data.forEach((d, i) => {
	obj = {...obj, [i]: d}
})
ready

Revisions

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