Test case name | Result |
---|---|
Array.from(new Array(length), () => new Array(length)) | |
Array.from({length}, () => new Array(length)) | |
for push | |
for index | |
Array.from(Array(length), () => new Array(length)) | |
for push set size | |
for index set size |
Test name | Executions per second |
---|---|
Array.from(new Array(length), () => new Array(length)) | 160453.8 Ops/sec |
Array.from({length}, () => new Array(length)) | 150472.2 Ops/sec |
for push | 227218.6 Ops/sec |
for index | 239894.0 Ops/sec |
Array.from(Array(length), () => new Array(length)) | 161594.3 Ops/sec |
for push set size | 221498.6 Ops/sec |
for index set size | 233617.0 Ops/sec |