Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

_.extend Example



p = _.extend(Person.prototype, {a:"AAAAAAAA"});
var x =  new p.constructor("some extra stuff");
console.log(x.a);
console.log(x.firstName);
/*has both a="AAAAAAA" and firstName="some extra stuff"*/
/*add stuff to the second, you can think of it as*/
 
PREVIOUS NEXT
Tagged: #Example
ADD COMMENT
Topic
Name
8+6 =