Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
instanceof vs typeof vs Object.prototype.toString.call
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:140.0) Gecko/20100101 Firefox/140.0
Browser:
Firefox 140
Operating system:
Linux
Device Platform:
Desktop
Date tested:
10 months ago
Test name
Executions per second
instanceof
121985584.0 Ops/sec
typeof
1285562240.0 Ops/sec
typeof no function
1106768384.0 Ops/sec
Object.prototype.toString.call ==
1449307776.0 Ops/sec
Object.prototype.toString.call ===
1562626688.0 Ops/sec
Script Preparation code:
var obj = {a:2};
Tests:
instanceof
obj instanceof Object
typeof
typeof obj === 'object'
typeof no function
typeof obj === 'object' && typeof obj !== 'function'
Object.prototype.toString.call ==
"[object Object]" == Object.prototype.toString.call(obj)
Object.prototype.toString.call ===
"[object Object]" === Object.prototype.toString.call(obj)