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.prototype.hasOwnProperty | no | ✅ |
“in” Operator | ✅ | ✅ |
Reflect.has | ✅ | ✅ |
Enumerate Properties
syntax | use proto chain | Enumerable only | include Symbol Key | include string key |
---|---|---|---|---|
for-in Loop | ✅ | ✅ | no | ✅ |
for-of Loop | N/A | N/A | N/A | N/A |
List Properties
JavaScript, Property
- JS: Property Overview
- JS: Property Key
- JS: Property Dot Notation vs Bracket Notation
- JS: Create Property
- JS: Delete Property
- JS: Get Set Property
- JS: Check Property Existence
- JS: Access Property
- JS: List Properties
- JS: for-in Loop
- JS: Enumerable Property
- JS: Property Attributes
- JS: Property Descriptor
- JS: Getter Setter Properties