Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Example Of _.extend


class Person
{
  constructor(firstName)
  {
    this.firstName = firstName
  }
}

class Thing
{
  constructor()
  {
    this.addProperty = "firstName";
  }
}
 

 _.extend(Person.prototype, Thing.property);

const p = new Person("james");
console.log(p.addedProperty);
 
PREVIOUS NEXT
Tagged: #Example #Of
ADD COMMENT
Topic
Name
2+4 =