Study Memos/JavaScript Basic

상속 (Section 28)

Praiv. 2020. 10. 27. 03:38

참고> opentutorials.org/course/743/6572

 

1. prototype : 객체에 기본적으로 있음, 상속에 사용
ex) child.prototype = new Parent();

2. child에 함수를 추가하려면..
    chid.prototype.myNewFunc = function() {...}

반응형