Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
asdfasdfiuasgubasb[iunab[vn
(version: 1)
Comparing performance of:
instanceof vs typeof
Created:
one year ago
by:
Guest
Jump to the latest result
Script Preparation code:
class Foo { constructor() { this.isStatic = true; } } class Bar extends Foo { constructor() { super(); this.isStatic = false; } } const bar = new Bar();
Tests:
instanceof
Boolean(bar instanceof Bar)
typeof
Boolean(bar.isStatic)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
instanceof
typeof
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36
Browser/OS:
Chrome 135 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
instanceof
152234752.0 Ops/sec
typeof
165024640.0 Ops/sec
Related benchmarks:
test for null(2)
instanceof vs type
Ts trivial getter vs method
Property Assignment vs Symbol Assignment in Class Constructor
Class method / instance method / bind this
InstanceOf vs String type 2
detecting if var is instance of class
instanceof vs manual checking
class declaration vs class expression 2
Comments
Confirm delete:
Do you really want to delete benchmark?