数组操作-数组元素赋值

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
通过Array创建
const array = Array(20)
for (let i = 0; i < array.length; i++) {
	array[i] = i;
}
ready
直接创建
const array = [,,,,,,,,,,,,,,,,,,,,]
for (let i = 0; i < array.length; i++) {
	array[i] = i;
}
ready

Revisions

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