Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Chrome 131
Windows
Desktop
one year ago
Test name Executions per second
typeof -> string 16324903.0 Ops/sec
Object.prototype.toString.call -> string 6476530.0 Ops/sec
typeof -> boolean 16611017.0 Ops/sec
Object.prototype.toString.call -> boolean 6472016.0 Ops/sec
typeof -> object 16252367.0 Ops/sec
Object.prototype.toString.call -> object 6446493.0 Ops/sec
typeof -> function 16607866.0 Ops/sec
Object.prototype.toString.call -> function 6519179.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