Skip to content

Instantly share code, notes, and snippets.

View RacingTadpole's full-sized avatar

Arthur Street RacingTadpole

View GitHub Profile
// Crockford's new_constructor
// Act III: Function the Ultimate
// yuiblog.com/crockford
function new_constructor(extend, initializer, methods) {
var func, prototype = Object.create(extend &&
extend.prototype);
if (methods) {
methods.keys().forEach(function (key) {
prototype[key] = methods[key];