Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:131.0) Gecko/20100101 Firefox/131.0
Firefox 131
Mac OS X 10.15
Desktop
one year ago
Test name Executions per second
typeof -> string 15782823.0 Ops/sec
Object.prototype.toString.call -> string 2924286.2 Ops/sec
typeof -> boolean 11151455.0 Ops/sec
Object.prototype.toString.call -> boolean 2923550.2 Ops/sec
typeof -> object 10339821.0 Ops/sec
Object.prototype.toString.call -> object 2891378.5 Ops/sec
typeof -> function 13957343.0 Ops/sec
Object.prototype.toString.call -> function 3182986.5 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