Skip to content

Instantly share code, notes, and snippets.

@tsmsogn
Created December 19, 2012 00:28
Show Gist options
  • Select an option

  • Save tsmsogn/4333381 to your computer and use it in GitHub Desktop.

Select an option

Save tsmsogn/4333381 to your computer and use it in GitHub Desktop.
JavaScript: Extends function
function extend(target, ref) {
var name, value;
for ( name in ref ) {
value = ref[name];
if (value !== undefined) {
target[ name ] = value;
}
}
return target;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment