Test name | Executions per second |
---|---|
instanceof | 166165632.0 Ops/sec |
string type | 1828309760.0 Ops/sec |
string type + undefined | 1825063808.0 Ops/sec |
property | 1749559296.0 Ops/sec |
<script>
class TestClass {
constructor() {
this.a = 2;
this.t = 'mesh';
}
}
</script>
var obj = new TestClass();
obj instanceof TestClass;
obj.t === 'mesh'
obj.t !== undefined
obj.a !== undefined