When creating an object (prior to ES6) one could instantiate an object like so...
var Animal = function(){}
and then
var dog = new Animal();
...
Inside the animal "class" one can add...
var Animal = function( name ){
this.constructor.prototype.name = name;
}
The question is basically, what is the difference between using the regular this
in oppose to using this.constructor.prototype
var Animal = function( name ){
// what is the difference between this
this.constructor.prototype.name = name;
// and that
this.name = name;
}
I know this kind of basic, if anyone would care to explain. Thanks in advance!