Front/JavaScript
[JavaScript] 인스턴스화 (Instantation)
class Player { constructor(name, type) { console.log(this); // Wizard{} this.name = name; this.type = type; } introduce() { console.log(`Hi I am ${this.name}, I'm a ${this.type}`); }}class Wizard extends Player { constructor(name, type) { super(name, type); // Player 의 constructor 실행 console.log('wizard', this); // Wizard {name:"Shelly", type:"Healer"} ..