Test name | Executions per second |
---|---|
forloop | 43373.2 Ops/sec |
for-of | 36844.6 Ops/sec |
forEach | 42020.1 Ops/sec |
const array = [Array(1000).keys()]
for(let i = 0; i < array.length; i++) {
const n = array[i];
}
const array = [Array(1000).keys()]
for(const n of array) {
}
const array = [Array(1000).keys()]
array.forEach(n => {});