hi, how can i call super constructor from the inheriting object? for example, i have a simple animal 'class':
function Animal(legs) {
this.legs = legs;
}
i want to create a 'Chimera' class that inherits from Animal but sets the number of legs to a random number (providing the maximum number of legs in the constructor. so far i have this:
function Chimera(maxLegs) {
// generate [randLegs] maxed to maxLegs
// call Animal's constructor with [randLegs]
}
Chimera.prototype = new Animal;
Chimera.prototype.constructor = Chimera;
how to call Animal's constructor? thanks