Hi all,
So I'm learning Javascript and all its' prototype goodness, and I am stumped over the following:
Say I have this
var Animal = function (a, b, c, d, e, f, g, h, i, j, k , l, m, n){
this.a = a;
this.b = b;
//...etc...
};
var x = new Animal(1,2,3....);
Now how do I create a Cat constructor function that inherits from the Animal constructor function such that I don't have to type the super long arguments again?
In other words I don't want to be doing this:
var Cat = function (a, b, c, d, e, f, g, h, i, j, k , l, m, n){
this.a = a;
this.b = b;
//...etc...
};
// inherit functions if any
Cat.prototype = new Animal;
var y = new Cat(1,2,3....);
Thanks in advance! j