Skip to content

Instantly share code, notes, and snippets.

@michalkowol
Created October 23, 2014 20:27
Show Gist options
  • Save michalkowol/f6ca3c360f703c370754 to your computer and use it in GitHub Desktop.
Save michalkowol/f6ca3c360f703c370754 to your computer and use it in GitHub Desktop.
function _extend(object, source) {
for (var key in source) {
if (source.hasOwnProperty(key)) {
object[key] = source[key];
}
}
return object;
}
function _with() {
var self = {};
var args = Array.prototype.slice.call(arguments);
for (var i = 0; i < args.length; i++) {
args[i](self);
}
self.super = _extend({}, self);
return self;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment