.forEach vs for..of vs for..of (destructuring) vs .map vs .map (destructuring) vs .for (init array) vs .reduce vs .reduce (destructuring) vs for..of (reduce) vs for..of (reduce) (destructuring)| Test case name | Result |
|---|---|
| .forEach | |
| for..of | |
| for..of (destructuring) | |
| .map | |
| .map (destructuring) | |
| .for (init array) | |
| .reduce | |
| .reduce (destructuring) | |
| for..of (reduce) | |
| for..of (reduce) (destructuring) |
| Test name | Executions per second |
|---|---|
| ✓ .for (init array) | 75 Ops/sec |
| .reduce | 55 Ops/sec |
| .reduce (destructuring) | 54 Ops/sec |
| for..of (reduce) | 49 Ops/sec |
| for..of | 48 Ops/sec |
| for..of (reduce) (destructuring) | 48 Ops/sec |
| .forEach | 42 Ops/sec |
| for..of (destructuring) | 39 Ops/sec |
| .map (destructuring) | 39 Ops/sec |
| .map | 37 Ops/sec |