Run details:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Mobile Safari/537.36
Chrome Mobile 131
Android
Mobile
one year ago
Benchmark.js
typeof -> string
7.0M/s
typeof -> boolean
6.6M/s
typeof -> function
6.4M/s
typeof -> object
6.3M/s
Object.prototype.toString.call -> string
2.3M/s
Object.prototype.toString.call -> boolean
2.3M/s
Object.prototype.toString.call -> function
2.2M/s
Object.prototype.toString.call -> object
2.2M/s
View exact numbers
Test name Executions per second
typeof -> string 6,959,206 Ops/sec
typeof -> boolean 6,640,119 Ops/sec
typeof -> function 6,376,422 Ops/sec
typeof -> object 6,319,894 Ops/sec
Object.prototype.toString.call -> string 2,304,327 Ops/sec
Object.prototype.toString.call -> boolean 2,260,168 Ops/sec
Object.prototype.toString.call -> function 2,245,614 Ops/sec
Object.prototype.toString.call -> object 2,223,963 Ops/sec
Script Preparation code:
Tests: