Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
Chrome 129
Windows
Desktop
one year ago
Test name Executions per second
typeof -> string 782420.1 Ops/sec
Object.prototype.toString.call -> string 321892.4 Ops/sec
typeof -> boolean 821962.4 Ops/sec
Object.prototype.toString.call -> boolean 335538.4 Ops/sec
typeof -> object 905779.2 Ops/sec
Object.prototype.toString.call -> object 317401.7 Ops/sec
typeof -> function 847992.2 Ops/sec
Object.prototype.toString.call -> function 307520.8 Ops/sec
Script Preparation code:
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