Nullish coalescing (??) vs Logical OR (||) vs Nullish coalescing (??) [short-circuit] vs Logical OR (||) [short-circuit]Fastest: Nullish coalescing (??) [short-circuit] (50.3x faster)
177,498,640 ops/sec
174,967,824 ops/sec
3,541,100 ops/sec
3,528,632 ops/sec
Fastest: Nullish coalescing (??) [short-circuit] (1.5x faster)
1,640,271,232 ops/sec
1,638,822,656 ops/sec
1,584,768,128 ops/sec
1,107,588,736 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| Nullish coalescing (??) | |
| Logical OR (||) | |
| Nullish coalescing (??) [short-circuit] | |
| Logical OR (||) [short-circuit] |
| Test name | Executions per second |
|---|---|
| ✓ Logical OR (||) | 232,733,984 Ops/sec |
| Nullish coalescing (??) | 232,164,400 Ops/sec |
| Nullish coalescing (??) [short-circuit] | 215,801,280 Ops/sec |
| Logical OR (||) [short-circuit] | 213,673,376 Ops/sec |