I am trying to emulate inheritance in javascript using a the Lo-Dash javascript library.
I am simply using _.extend to do so:
function Parent() {
var self = this;
self.hello = function () {
console.log('Hello from parent');
};
}
function Child() {
var self = this;
_.extend(self, Parent);
}
Child.hello(); // Doesn't exist
I thought this would work since all javascript functions are objects but obviously I am wrong. Why doesn't this work and how would I properly emulate inheritance using Lo-Dash?