Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

_.extend can be used to attach functions to a prototype like this


_.extend(Person.prototype, {hello:function()
{console.log("hello world")}

});

p = new Person("John", "Smith");
p.hello();
 
PREVIOUS NEXT
Tagged: #attach #functions #prototype
ADD COMMENT
Topic
Name
5+2 =