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 16465786.0 Ops/sec
Object.prototype.toString.call -> string 6391382.5 Ops/sec
typeof -> boolean 17911116.0 Ops/sec
Object.prototype.toString.call -> boolean 6779731.0 Ops/sec
typeof -> object 17353628.0 Ops/sec
Object.prototype.toString.call -> object 6834485.0 Ops/sec
typeof -> function 17717500.0 Ops/sec
Object.prototype.toString.call -> function 6781398.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