Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Chrome 131
Windows
Desktop
one year ago
Benchmark.js
typeof -> boolean
17.9M/s
typeof -> function
17.7M/s
Object.prototype.toString.call -> object
6.8M/s
Object.prototype.toString.call -> function
6.8M/s
Object.prototype.toString.call -> boolean
6.8M/s
Object.prototype.toString.call -> string
6.4M/s
View exact numbers
| Test name |
Executions per second |
|
✓
typeof -> boolean
|
17,911,116 Ops/sec |
|
typeof -> function
|
17,717,500 Ops/sec |
|
typeof -> object
|
17,353,628 Ops/sec |
|
typeof -> string
|
16,465,786 Ops/sec |
|
Object.prototype.toString.call -> object
|
6,834,485 Ops/sec |
|
Object.prototype.toString.call -> function
|
6,781,398 Ops/sec |
|
Object.prototype.toString.call -> boolean
|
6,779,731 Ops/sec |
|
Object.prototype.toString.call -> string
|
6,391,382 Ops/sec |
Tests:
-
typeof -> string
-
Object.prototype.toString.call -> string
-
typeof -> boolean
-
Object.prototype.toString.call -> boolean
-
typeof -> object
-
Object.prototype.toString.call -> object
-
typeof -> function
-
Object.prototype.toString.call -> function