Test case name | Result |
---|---|
Classic for loop | |
Optimised classic for loop | |
While loop | |
Optimised while loop | |
Array.prototype.forEach | |
Array.prototype.reduce | |
For - of loop | |
For - in loop |
Test name | Executions per second |
---|---|
Classic for loop | 15152.5 Ops/sec |
Optimised classic for loop | 28270.7 Ops/sec |
While loop | 15154.4 Ops/sec |
Optimised while loop | 28216.8 Ops/sec |
Array.prototype.forEach | 271921.3 Ops/sec |
Array.prototype.reduce | 2686007.5 Ops/sec |
For - of loop | 733112.5 Ops/sec |
For - in loop | 22517.9 Ops/sec |