-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Labels
Description
질문
스프레드 문법을 통해 객체의 불변성을 지킬 수 있습니다.
이 외에 객체의 불변성을 지킬 수 있는 다른 방법은 뭐가 있을까요?
또, 불변성을 신경쓰는 것에 대한 생각을 공유해주세요 : )
관련 챕터
35장
참고
const order = {id: 1, order: 'Americano', addMilk: true};
const change = {addMilk: false};
const newOrder = {...order, ...change }; // output: {id: 1, order: "Americano", addMilk: false}