Number.isInteger() positive vs typeof positive vs Number.isInteger() negative vs typeof negativeFastest: typeof negative (1.3x faster)
178,884,064 ops/sec
174,995,712 ops/sec
140,822,112 ops/sec
139,442,560 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| Number.isInteger() positive | |
| typeof positive | |
| Number.isInteger() negative | |
| typeof negative |
| Test name | Executions per second |
|---|---|
| ✓ typeof positive | 1,531,819,392 Ops/sec |
| typeof negative | 1,497,396,352 Ops/sec |
| Number.isInteger() negative | 1,445,254,912 Ops/sec |
| Number.isInteger() positive | 1,311,527,296 Ops/sec |