Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36
Chrome 119
Windows
Desktop
2 years ago
Benchmark.js
typeof -> boolean
2.3M/s
typeof -> function
2.2M/s
typeof -> object
2.2M/s
typeof -> string
2.2M/s
Object.prototype.toString.call -> object
801K/s
Object.prototype.toString.call -> string
797K/s
Object.prototype.toString.call -> boolean
795K/s
Object.prototype.toString.call -> function
777K/s
View exact numbers
Test name Executions per second
typeof -> boolean 2,326,319 Ops/sec
typeof -> function 2,206,809 Ops/sec
typeof -> object 2,203,048 Ops/sec
typeof -> string 2,187,199 Ops/sec
Object.prototype.toString.call -> object 800,838 Ops/sec
Object.prototype.toString.call -> string 797,323 Ops/sec
Object.prototype.toString.call -> boolean 794,768 Ops/sec
Object.prototype.toString.call -> function 776,964 Ops/sec
Script Preparation code:
Tests: