로딩
요청 처리 중입니다...

[javaScript] class 상속

 [javaScript] class 상속

** 기준이 되는 클래스 상속 코드 class Employee { constructor(firstName, lastName){ this.firstName = firstName; this.lastName = lastName; } getFullName(){ return `${this.firstName} ${this.lastName}`; } getInitials(){ return this.firstName[0] + this.lastName[0]; //이름의 첫([0]) 글자를 조합하여 반환 } } class Manager extends Employee{ //Employee클래스를 상속 받기 위해서 extends를 사용해야 한다. getFullName(){ return `${this.firstName} ${this.lastName} (manager)`; } sendPer(){ console.log("상속받아요~") } } const manager = new Manager("...

# class # 상위클래스_호출 # this # super # script # new # javaScript # extends # constructor # 클래스상속