Skip to content

Instantly share code, notes, and snippets.

@ThisIsMissEm
Created December 6, 2009 11:06
Show Gist options
  • Save ThisIsMissEm/250165 to your computer and use it in GitHub Desktop.
Save ThisIsMissEm/250165 to your computer and use it in GitHub Desktop.
jet.mixin = function(/*Object*/ target, /*Object*/ source){
for(var prop in source){
if(source.hasOwnProperty(prop) && (!(prop in target) || target[prop] !== source[prop])){
if(typeof source[prop] === "object"){
target[prop] = jet.mixin(target[prop], source[prop]);
} else {
target[prop] = source[prop];
}
}
}
return target;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment