: 하나의 변수안에 여러가지의 정보가 담겨있을때 적합한 자료루조
-{}중괄호를 이용해 객체를 만들고 키-값 쌍은 쉼표로 구분
-데이터에 의미 부여 가능
객체의 값을 사용하는 방법
Dot notation: .
을 이용해 접근, 속성을 이용해 값을 가져오는 것
ex)user.city
Bracket notation: []
대괄호를 이용해 접근, 안에는 ''
나 ""
필요, 키 값이 변할때
ex)user['city']
*정확히 구분하기
let user={name: '나율', city: 'jinju'}
user.city===user['city'] //true
만약 let city='writer'
user.city===user[city]. //false
user[city]===user['writer'] //true
=> ''
가 없으면 변수로 취급
객체 다루기
delete
이용in
이용해 해당하는 키가 있는지 확인 let user={name: '나율', city: 'jinju'}
user['age']= '24'; //bracket 이용한 추가
user.hobby ='singing'; //dot 이용한 추가
user.name= '능'; //변경
user['age']= '12; // 변경
delete user.name; //삭제
'city' in user; //조회 true