강의

멘토링

커뮤니티

Inflearn Community Q&A

hangja63635248's profile image
hangja63635248

asked

Advanced Modern JavaScript (ES6+)

8. Built-in object inheritance, Object inheritance, Image object inheritance, Audio object inheritance

constructor(){ super() }; 에 대해 문의 드립니다.

Written on

·

182

0

선생님 안녕하세요. 항상 좋은 강의 감사드립니다!

이번 강의의 예제들에서 constructor(){ super() }; 를 작성하셨는데요,
이것을 작성하지 않아도 constructor(){}가 없으면,
Point.prototype의 constructor를 호출하고, 그 후에 Array.prototype의 constructor를 호출하면서 생성하는 인스턴스의 __proto__.__proto__에 Array.prototype의 메소드가 첨부(참조)되는 것으로 이해하여,
constructor(){ super() }; 작성하지 않고 인스턴스를 생성해도 동일한 결과를 같는 걸로 확인되는데 제가 확인한 게 맞을까요...?
constructor(){ super() }; 를 작성하지 않아도 결과는 동일하지만 상속 받음을 조금 더 명시하기 위해 작성하는 것으로 이해해도 될까요...?
es6javascript

Answer

This question is waiting for answers
Be the first to answer!
hangja63635248's profile image
hangja63635248

asked

Ask a question