Access
1. Dot notation
const obj = {
notation: 'dot',
application: {
name: 'instagram',
type: 'social'
}
obj.notation
obj.application.name
obj.application.type
2. Bracket notation
const obj = {
notation: 'bracket',
application: {
name: 'calculator',
type: 'utility'
}
obj['notation']
obj['application'].name
obj.application['type']
Add, Modify
1. Dot notation
const obj = {
name: 'amex'
}
obj.type = 'finance'
obj.name = 'binance'
obj.name
obj.type
2. Bracket notation
const obj = {
name: 'nike',
}
obj['type'] = 'shopping'
obj['name'] = 'ikea'
obj['name']
obj['type']
Delete
const obj = {
name: 'gosegu'
height: 300
}
delete obj.name
delete obj[height]
obj.name
obj[height]