Class (1) 썸네일형 리스트형 super class calCul{ constructor(name,first,second){ this.name = name; this.first = first; this.second = second; } sum(){ return `${this.name} : ` + (this.first + this.second); } } let park = new calCul('park',10,20); console.log(park.sum()); 위 코드 내용을 살리고 추가적으로 더 함수 인자를 받거나 메소드를 만들고 싶다면 extends 로 calCul을 상속받아 새로운 class를 작성할 수 있다. class calCul{ constructor(name,first,second){ this.name = name; this.firs.. 이전 1 다음