typeof string is undefined vs typeof undefined is undefined vs string is undefined vs undefined is undefinedFastest: typeof string is undefined (23.5x faster)
152,348,896 ops/sec
12,741,343 ops/sec
12,469,086 ops/sec
6,486,746 ops/sec
Fastest: typeof string is undefined (1.1x faster)
1,133,128,832 ops/sec
1,119,731,072 ops/sec
1,095,505,792 ops/sec
1,017,315,904 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| typeof string is undefined | |
| typeof undefined is undefined | |
| string is undefined | |
| undefined is undefined |
| Test name | Executions per second |
|---|---|
| ✓ undefined is undefined | 243,970,304 Ops/sec |
| typeof string is undefined | 235,450,816 Ops/sec |
| string is undefined | 226,660,032 Ops/sec |
| typeof undefined is undefined | 224,156,416 Ops/sec |