/ Published in: JavaScript
# addMethod - By John Resig (MIT Licensed)
Add a method to an object. Creates function overloading scenario based entirely on length of argument list. Won't work to overload functions according to argument "type".
# inherit
Create parameter-less inheritance chain for situations in which the parent object takes arguments in its "constructor".
Usage:
function A(a, b) { }
function B() { A.call(this, 1, 2); }
B.prototype = inherit(A.prototype);
Add a method to an object. Creates function overloading scenario based entirely on length of argument list. Won't work to overload functions according to argument "type".
# inherit
Create parameter-less inheritance chain for situations in which the parent object takes arguments in its "constructor".
Usage:
function A(a, b) { }
function B() { A.call(this, 1, 2); }
B.prototype = inherit(A.prototype);