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