Test name | Executions per second |
---|---|
Basic for loop | 8156.5 Ops/sec |
For loop but caching the length | 630214.7 Ops/sec |
While loop that imitates a for loop | 8119.5 Ops/sec |
While loop that imitates a for loop caching len | 627630.3 Ops/sec |
While loop in reverse simplifying the test | 619832.8 Ops/sec |
While looping by popping values | 6114921.0 Ops/sec |
for ... in loop | 4116109.8 Ops/sec |
for ... in loop with integer test | 3842051.0 Ops/sec |
For loop testing on existence rather than lengt | 6594243.0 Ops/sec |
For loop testing on existence plus array lookup | 5880909.5 Ops/sec |
For testing on existence rather than length array | 6038332.0 Ops/sec |
For reference | 7409488.0 Ops/sec |
Array.forEach() native implementation. | 5811872.0 Ops/sec |
For reference against forEach() | 6668406.5 Ops/sec |