Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:141.0) Gecko/20100101 Firefox/141.0
Firefox 141
Windows
Desktop
9 months ago
Test name Executions per second
typeof -> string 27567416.0 Ops/sec
Object.prototype.toString.call -> string 3991418.0 Ops/sec
typeof -> boolean 15027905.0 Ops/sec
Object.prototype.toString.call -> boolean 4075635.5 Ops/sec
typeof -> object 12846283.0 Ops/sec
Object.prototype.toString.call -> object 3999299.0 Ops/sec
typeof -> function 24192610.0 Ops/sec
Object.prototype.toString.call -> function 4457707.0 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