object create (1) 썸네일형 리스트형 [JS/ES6] Object assign Object assign Object를 원초적, 직접적으로 할당받는 방법을 소개합니다. const healthObj = { showHealth : function() { console.log("오늘의 운동시간:" + this.healthTime); }}const myHealth = Object.assign(Object.create(healthObj), { name: "yj", healthTime: "15:00"});console.log("myhealth is ", myHealth);myHealth.showHealth(); Object.create(obj) 만 사용할 경우 object를 생성만 하고 값을 넣지 않은 형태입니다. 값을 따로 지정해주어야 합니다.Object.assign은 create 값과 넣을.. 이전 1 다음