Skip to content

Instantly share code, notes, and snippets.

@jzaefferer
Created April 27, 2011 21:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jzaefferer/945237 to your computer and use it in GitHub Desktop.
Save jzaefferer/945237 to your computer and use it in GitHub Desktop.
function extend( target ) {
var input = slice.call( arguments, 1 ),
inputIndex = 0,
inputLength = input.length
key,
value;
for ( ; inputIndex < inputLength; inputIndex++ ) {
for ( key in input[inputIndex] ) {
value = input[inputIndex];
if (value !== undefined ) {
target[key] = $.isPlainObject(value) ? extend( {}, value ) : value;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment