array = [] vs array length = 0 Fastest: array = [] (1.2x faster)
8,299,224 ops/sec
6,804,414 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| array = [] | |
| array length = 0 |
| Test name | Executions per second |
|---|---|
| ✓ array = [] | 9,938,955 Ops/sec |
| array length = 0 | 7,463,552 Ops/sec |