constructor which will inherit
super (parent) constructor
child constructor
function Foo() {
return this;
}
Foo.prototype.beep = function beep() {
return 'boop';
};
function Bar() {
Foo.call( this );
return this;
}
inherit( Bar, Foo );
var bar = new Bar();
var v = bar.beep();
// returns 'boop'
Implements prototypical inheritance by replacing the prototype of one constructor with the prototype of another constructor.
first argument must be either an object or a function which can inherit
second argument must be either an object or a function from which a constructor can inherit
second argument must have an inheritable prototype