toggle-toggle / javascript-basic

🌱우아한 테크코스 프론트엔드 자바스크립트 기초 스터디 입니다.
9 stars 0 forks source link

[Prototype] js class 상속을 prototype 상속과 관련지어 설명하세요 #32

Open Tanney-102 opened 3 years ago

Tanney-102 commented 3 years ago

참고 클래스 상속

shinsehantan commented 3 years ago
상속을 해주기위한 부모 클래스 Person
상속을 받은 자식 클래스 Shinsehantan
bucketHaneul commented 3 years ago

자바스크립트는 프로토타입 기반의 객체지향 언어입니다. es6에서 class가 등장하였지만, 그렇다고 해서 class기반으로 상속이 동작하지는 않고, 여전히 prototype을 기반으로 상속을 진행합니다. 자바스크립트에서 class 상속은 extends 키워드를 사용하고, constructor에서 사용한 super() 함수가 상속받은 클래스의 생성자를 가르킵니다.

ddongule commented 3 years ago
Tanney-102 commented 3 years ago