Javascript's inheritance is prototype based, so you extend the prototypes of objects such as Date, Math, and even your own custom ones. spa
Date.prototype.lol = function() { alert('hi'); }; ( new Date ).lol() // alert message
In the snippet above, I define a method for all Date objects ( already existing ones and all new ones ). prototype
extend is usually a high level function that copies the prototype of a new subclass that you want to extend from the base class. code
So you can do something like: ip
extend( Fighter, Human )
And the Fighter constructor/object will inherit the prototype of Human, so if you define methods such as live and die on Human then Fighter will also inherit those. it