prototype (1) 썸네일형 리스트형 [해커랭크] Day 5: Inheritance (javascript) 제공되는 Rectangle class로부터 area 메소드를 추가하고, Rectangle class를 상속받는 Square class 만들기 조건 및 제한사항 Rectangle의 prototype에 area 메소드 추가 아래 조건을 만족하는 Square class 생성 Rectangle의 하위클래스 생성자(constructor)만 포함하고 다른 메서드는 불포함 Rectangle 클래스의 area 메소드를 사용하여 Square의 area를 출력 나의 풀이 Rectangle.prototype.area = function() {} 을 이용하여 prototype 메소드 추가 Arrow Function을 사용하지 않은 이유는 메소드로 사용할 수 없기 때문 참고: (https://developer.mozilla... 이전 1 다음