... 기능(?)으로 자바스크립트에서 거의 모든 객체는 Object의 인스턴스이고, 이런 Object는 prototype을 통해 속성이나 메서드를 상속받습니다. function...
태그:
안녕하세요 자바스크립트를 혼자 공부하는데요, 상속이 헷갈립니다.... student1.prototype = Object.create(Person.prototype) // 1 student1.prototype.constructor...
태그:
[code] function Account(balance){ this.balance = balance; } Account.prototype.... [/code] Account는 superAccount를 상속하는 객체입니다 Account의...
태그:
자바스크립트 상속이랑 프로토타입이요 초등학생도 이해될만하게... Hakseng.prototype.getHap = function () { return this.국어 + this.수학 + this.영어 + this....
태그:
... Rectangle.prototype.getArea = function() { //이한줄 return this.getwidth() * this.... this.base(lenght, lenght); } Square.prototype = Rectangle.prototype; //이5줄이요...
태그:
... Child.super = Parent.prototype; } } 스토얀 스테파노프의 최적화된 상속 함수라는데. Child.prototype.constructor = Child; 부분은 구지 안써도 될 것...
태그:
자바스크립트 클로저 부분에 대해 공부하는 중인데요 function... <- 그 후에 HelloFunc에서 prototype으로 선언해둔 call은 상속이 되기때문에...
... 자바스크립트는 prototype을 사용하여 객체간의 메소드와 프로퍼티를 상속 받습니다. 따라서 prototype 사용하여 함수(메소드) 나 변수(프로퍼티)를 선언하면 해당...
태그:
... 메소드를 상속받습니다. study 메소드는 'Let's study (major)... ex) FeStudent.prototype.study = function () {...}; 사용 X */ class Student { constructor...
태그:
... 메소드를 상속받습니다. study 메소드는 'Let's study (major)... ex) FeStudent.prototype.study = function () {...}; 사용 X */ class Student { constructor...
태그: