Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
Chrome 120
Mac OS X 10.15.7
Desktop
2 years ago
Benchmark.js
typeof -> function
1.9M/s
Object.prototype.toString.call -> boolean
750K/s
Object.prototype.toString.call -> string
748K/s
Object.prototype.toString.call -> object
747K/s
Object.prototype.toString.call -> function
746K/s
View exact numbers
| Test name |
Executions per second |
|
✓
typeof -> string
|
2,005,123 Ops/sec |
|
typeof -> boolean
|
1,975,382 Ops/sec |
|
typeof -> function
|
1,943,450 Ops/sec |
|
typeof -> object
|
1,940,927 Ops/sec |
|
Object.prototype.toString.call -> boolean
|
749,721 Ops/sec |
|
Object.prototype.toString.call -> string
|
748,327 Ops/sec |
|
Object.prototype.toString.call -> object
|
747,494 Ops/sec |
|
Object.prototype.toString.call -> function
|
745,943 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