Есть такой код:
function Ball(param) {
this._radius = param.radius;
this._color = param.color;
}
Ball.protorype = {
constructor: Ball,
INCREMENTATION_STEP: 5,
draw: function () {
console.log("ball drawn with radius:" + this._radius + " and color: " + this._color);
},
inc: function () {
this._radius += this.INCREMENTATION_STEP;
}
}
bb = new Ball({
radius: 100,
color: "red"
});
bb.draw();
Он не видит метод draw и пишет:
bb.draw is not a function.
Что делать?