Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36
Chrome 122
Mac OS X 10.15.7
Desktop
2 years ago
Benchmark.js
typeof -> function
2.1M/s
Object.prototype.toString.call -> function
745K/s
Object.prototype.toString.call -> object
737K/s
Object.prototype.toString.call -> boolean
736K/s
Object.prototype.toString.call -> string
733K/s
View exact numbers
| Test name |
Executions per second |
|
✓
typeof -> boolean
|
2,108,823 Ops/sec |
|
typeof -> string
|
2,103,729 Ops/sec |
|
typeof -> function
|
2,055,565 Ops/sec |
|
typeof -> object
|
2,051,090 Ops/sec |
|
Object.prototype.toString.call -> function
|
745,321 Ops/sec |
|
Object.prototype.toString.call -> object
|
736,528 Ops/sec |
|
Object.prototype.toString.call -> boolean
|
735,933 Ops/sec |
|
Object.prototype.toString.call -> string
|
732,640 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