for vs for of vs for in vs forEach vs for 2 vs while with shift vs while vs while with length reduction vs for reverse| Test case name | Result |
|---|---|
| for | |
| for of | |
| for in | |
| forEach | |
| for 2 | |
| while with shift | |
| while | |
| while with length reduction | |
| for reverse |
| Test name | Executions per second |
|---|---|
| ✓ while | 27,336,246 Ops/sec |
| forEach | 25,731,544 Ops/sec |
| for 2 | 25,599,286 Ops/sec |
| for reverse | 23,216,702 Ops/sec |
| for of | 22,831,210 Ops/sec |
| while with length reduction | 20,193,752 Ops/sec |
| for | 19,339,656 Ops/sec |
| while with shift | 2,010,042 Ops/sec |
| for in | 816,928 Ops/sec |