Person = function(name)
{
this.name = name;
}
_.extend(Person.prototype, {x: function(){return this.name+"XXXXXXXXX"}});
const p = new Person("John smith");
console.log(p.x());
Person = function(name)
{
this.name = "name";
this.a = function(a)
{console.log(a)
}
this.a(this.name);
this.b();
}
_.extend(Person.prototype, {x: function(){console.log(this.name)}, b: function(){console.log("BBBBBBBBBBBBB")}});
const p= new Person("XXXX");
p.x();
the above is valid code so long as a this.name exists in the Person.prototype
the this.b() is also valid code so long as b() is added in later at the _.extend() part.