spread와 rest
TIL
... 문법은 사용 위치에 따라 spread 또는 rest로 동작한다. spreadspread 연산자는 배열이나 객체를 펼쳐서 개별 요소로 분리한다.사용 시점객체나 배열을 복사하거나 합칠 때함수 호출 시 배열의 요소를 개별 인수로 전달할 때 객체 복사 및 확장const toy = { type: "bear", price: 15000,};const blueToy = { ...toy, color: "blue",};const yellowToy = { ...toy, color: "yellow",};console.log(blueToy); // { type: 'bear', price: 15000, color: 'blue' }console.log(yellowToy); // { type: 'bear', pri..