event listener와 constructor
const 객체 = {}
function 공장() {
this.이름 = 'kim' //여기서의 this는 새로 생성되는 오브젝트 (instance)를 뜻한다.
}
const 오브젝트 = new 공장();
console.log(오브젝트)
// 결과)
공장 {이름: "kim"}
Last updated
Was this helpful?
const 객체 = {}
function 공장() {
this.이름 = 'kim' //여기서의 this는 새로 생성되는 오브젝트 (instance)를 뜻한다.
}
const 오브젝트 = new 공장();
console.log(오브젝트)
// 결과)
공장 {이름: "kim"}
Last updated
Was this helpful?