08.08.14, 15:24
Not sure why, but when trying to chain constructors with call() or apply(), nothing happens.https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function/call
i.e. extending the Point object :
function PointW( x, y, w ) { Point.call( this, x, y ); //call the Point constructor for this object this.weight = w; //set additional values } PointW.prototype = new Point(); //inherit Point methods/vars