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
Benchmark.js
typeof -> object
906K/s
typeof -> function
848K/s
typeof -> boolean
822K/s
typeof -> string
782K/s
Object.prototype.toString.call -> boolean
336K/s
Object.prototype.toString.call -> string
322K/s
Object.prototype.toString.call -> object
317K/s
Object.prototype.toString.call -> function
308K/s
View exact numbers
Test name Executions per second
typeof -> object 905,779 Ops/sec
typeof -> function 847,992 Ops/sec
typeof -> boolean 821,962 Ops/sec
typeof -> string 782,420 Ops/sec
Object.prototype.toString.call -> boolean 335,538 Ops/sec
Object.prototype.toString.call -> string 321,892 Ops/sec
Object.prototype.toString.call -> object 317,402 Ops/sec
Object.prototype.toString.call -> function 307,521 Ops/sec
Script Preparation code:
Tests: