Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
`Object.assign` for browsers that don't support it
function mixin(target, source) {
var from;
var to = target;
var index = 0;
var total = arguments.length;
var hasOwnProperty = Object.prototype.hasOwnProperty;
while(++index < total){
from = arguments[index];
if (from != null) {
for(var key in from) {
if (hasOwnProperty.call(from, key)) {
to[key] = from[key];
}
}
}
}
return to;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.