Gudsaf,
var ball = new ball(1,2,3,4);
function ball (A,B,C,D){
this.a = A;
this.b = B;
this.c = C;
this.size = calcSize.bind(this)(D)
function calcSize(diameter){
return (this.a+this.b)*this.c*diameter; }
}
alert(ball.size);
может
var ball = new ball(1,2,3,4);
function ball (A,B,C,D){
this.a = A;
this.b = B;
this.c = C;
this.size = calcSize(D)
function calcSize(diameter){
return (A+B)*C*diameter;
}
}
alert(ball.size);