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 705186.2 Ops/sec
Object.prototype.toString.call -> string 312343.7 Ops/sec
typeof -> boolean 856719.3 Ops/sec
Object.prototype.toString.call -> boolean 343712.7 Ops/sec
typeof -> object 877468.6 Ops/sec
Object.prototype.toString.call -> object 261716.4 Ops/sec
typeof -> function 751849.6 Ops/sec
Object.prototype.toString.call -> function 360288.4 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