typeof vs Number.isNan vs isNaNFastest: typeof (4.0x faster)
177,789,472 ops/sec
53,650,168 ops/sec
44,862,920 ops/sec
Fastest: isNaN (1.2x faster)
634,747,840 ops/sec
630,163,520 ops/sec
550,879,936 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| typeof | |
| Number.isNan | |
| isNaN |
| Test name | Executions per second |
|---|---|
| ✓ isNaN | 634,555,136 Ops/sec |
| Number.isNan | 625,986,176 Ops/sec |
| typeof | 566,203,008 Ops/sec |