switch case vs array.includesFastest: switch case (2.0x faster)
135,523,328 ops/sec
68,073,520 ops/sec
Fastest: switch case (40.9x faster)
1,368,993,280 ops/sec
33,451,556 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| switch case | |
| array.includes |
| Test name | Executions per second |
|---|---|
| ✓ switch case | 2,209,950,208 Ops/sec |
| array.includes | 50,757,328 Ops/sec |