Skip to content

Instantly share code, notes, and snippets.

@private-face
Created January 6, 2012 16:29
Show Gist options
  • Save private-face/1571303 to your computer and use it in GitHub Desktop.
Save private-face/1571303 to your computer and use it in GitHub Desktop.
Extend
function extend(child, parent, /*optional*/ prototype) {
var F = function() {};
F.prototype = parent.prototype;
child.prototype = new F();
child.prototype.constructor = child;
child._super = parent.prototype;
if (prototype) {
$.extend(child.prototype, prototype);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment