JS: Access Property
Get
| syntax | use proto chain | work with Symbol Key |
|---|---|---|
obj.k
| ✅ | ✅ |
obj?.k
Optional Chaining Operator | ✅ | ✅ |
obj[k]
Dot Notation vs Bracket Notation | ✅ | ✅ |
| Reflect.get | ✅ | ✅ |
Set
| syntax | use proto chain | work with Symbol Key |
|---|---|---|
obj.k = v
| no | ✅ |
obj[k] = v
| no | ✅ |
| Reflect.set | no | ✅ |
Delete
| syntax | use proto chain | work with Symbol Key |
|---|---|---|
| delete (operator) ❌ | no | ✅ |
| Reflect.deleteProperty | no | ✅ |
Check Existence
| syntax | use proto chain | work with Symbol Key |
|---|---|---|
| Object.hasOwn | no | ✅ |
| Object.prototype.hasOwnProperty ❌ | no | ✅ |
| in (operator) | ✅ | ✅ |
| Reflect.has | ✅ | ✅ |