Javascript

Prototype(2)

농담농담 2022. 8. 20. 00:21

ES5방식으로 쉽게 구현하는 상속 기능

Object.create(물려받을 부모 객체)

 

프로토타입이 상속되고 있다.

ES6방식으로 구현하는 상속기능(Class)