Test name | Executions per second |
---|---|
Basic for loop | 78.7 Ops/sec |
For loop but caching the length | 2793.7 Ops/sec |
While loop that imitates a for loop | 80.5 Ops/sec |
While loop that imitates a for loop caching len | 2802.6 Ops/sec |
While loop in reverse simplifying the test | 1511.7 Ops/sec |
While looping by popping values | 6126212.5 Ops/sec |
for ... in loop | 4136056.8 Ops/sec |
for ... in loop with integer test | 3858173.5 Ops/sec |
For loop testing on existence rather than lengt | 5194579.0 Ops/sec |
For loop testing on existence plus array lookup | 6563195.5 Ops/sec |
For testing on existence rather than length array | 5880486.5 Ops/sec |
For reference | 7174041.0 Ops/sec |
Array.forEach() native implementation. | 5713008.0 Ops/sec |
For reference against forEach() | 6400156.5 Ops/sec |