what are the difference between,
var Human = function(){
this.age = 21;
};
and
Human.prototype.age = 31;
var ME = new Human();
document.write(ME.age);
It showing output 21, why not 31 ?
what are the difference between,
var Human = function(){
this.age = 21;
};
and
Human.prototype.age = 31;
var ME = new Human();
document.write(ME.age);
It showing output 21, why not 31 ?