var sl = sl || {}
sl.Shape = function(){
this.x = 0;
this.y = 0;
};
sl.Shape.prototype.move = function(x,y){
this.x += x;
this.y += y;
};
sl.Rectangle = function(){
sl.Shape.call(this);
this.z = 0;
};
다음 줄은 Object prototype undefined이거나 Object 또는 null이어야하는 오류를 생성합니다. 내가 볼 수있는 한 Shape은 "네임 스페이스"이기 때문입니다.자바 스크립트에서 네임 스페이스 내부의 클래스를 확장하는 방법은 무엇입니까?
sl.Rectangle.protoype = Object.create(sl.Shape.protoype);
sl.Rectangle.protoype.constructor = sl.Rectangle;
어떻게 올바르게 수행 할 수 있습니까?
감사 쓴! – Daniela