undefined vs typeof vs in vs hasOwnProperty vs bool vs Object.hasOwnProperty vs optional chaining undefined| Test case name | Result |
|---|---|
| undefined | |
| typeof | |
| in | |
| hasOwnProperty | |
| bool | |
| Object.hasOwnProperty | |
| optional chaining undefined |
| Test name | Executions per second |
|---|---|
| ✓ in | 127,650,680 Ops/sec |
| typeof | 126,078,144 Ops/sec |
| optional chaining undefined | 123,192,248 Ops/sec |
| undefined | 120,160,184 Ops/sec |
| bool | 106,656,024 Ops/sec |
| hasOwnProperty | 79,064,760 Ops/sec |
| Object.hasOwnProperty | 66,343,560 Ops/sec |