Created
January 6, 2015 21:58
-
-
Save BrettBukowski/75f126a85fb3c03cc65a to your computer and use it in GitHub Desktop.
JS extend
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
module.exports = function (props) { | |
var self = this; | |
function Child () { | |
self.call(this); | |
} | |
Child.prototype = Object.create(self.prototype); | |
for (var i in props) { | |
Child.prototype[i] = props[i]; | |
} | |
return Child; | |
}; | |
// var extend = require('./extend'); | |
// function Parent () {} | |
// Parent.extend = extend; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment