Created
December 19, 2012 00:28
-
-
Save tsmsogn/4333381 to your computer and use it in GitHub Desktop.
JavaScript: Extends function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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