The function below is one that Derek Banas on youtube on his OO Javascript tutorial uses.
function extend(Child, Parent){
var Temp = function(){};
Temp.prototype = Parent.prototype;
Child.prototype = new Temp();
Child.prototype.constructor = Child;
}
Why must we use the Temp prototype? Why can't we just do this:
function extend(Child, Parent){
Child.prototype = new Parent();
Child.prototype.constructor = Child;
}