March 27, 2001 - Using the Call Method
March 27, 2001 Using the Call Property Tips: March 2001
Yehuda Shiran, Ph.D.
|
function Shape() {
this.area = 100;
}
function Square() {
Shape.call(this);
}
Square.prototype = new Shape();
Shape1 = new Square();
The object Square
calls its prototype constructor, Shape
, using the call
property notation:
Shape.call(this);