#this

1 post

Javascript : 프로토타입과 this, call, apply, bind

Javascript : 프로토타입과 this, call, apply, bind

3분

프로토타입 javascript에는 클래스라는 개념이 없기 때문에, 자신이 다른 객체의 원형이 되는 객체를 의미 // Person에 대한 프로토타입 생성 function Person() { this.name; this.age; this.job; } // Person 프로토타입에 대한 setData 함수 생성 Person.prototype.setData=(name, age, job)=> { this.name=name; this.age=age; this.job=job; }; // …