Test name | Executions per second |
---|---|
from | 38.2 Ops/sec |
fill | 415.3 Ops/sec |
let n = 10000, length = 50;
const result = [];
for (let i = 0; i < n; ++i) {
result.push(Array.from({length}, _ => length));
}
let n = 10000, length = 50;
const result = [];
for (let i = 0; i < n; ++i) {
result.push(Array(length).fill(length));
}