Test name | Executions per second |
---|---|
instanceof | 154958880.0 Ops/sec |
property undefined | 1047604032.0 Ops/sec |
property in | 1335977600.0 Ops/sec |
<script>
class TestClass {
constructor() {
this.a = 2;
}
}
</script>
var obj = new TestClass();
obj instanceof TestClass;
obj.a !== undefined
'a' in obj