problem description
var inherit = (function () {
var F = function () {}; //
// function F() {}; //
return function (Target, Origin) {
F.prototype = Origin.prototype;
Target.prototype = new F();
Target.prototype.contructor = Target;
Target.prototype.uber = Origin.prototype;
}
}());
as shown in the note above:
the first is to store a function as a variable;
the second is to declare a constructor directly;
is mainly that both functions can be realized (both can be new objects), but I don"t quite understand the difference between the two ways.
which is better in the current method, why?
Please ask all the big gods and boys to solve their doubts, thank you! Thank you!