Last active
July 1, 2016 22:19
-
-
Save Bondifrench/936fdadd2817ef132db57e6573a5992f to your computer and use it in GitHub Desktop.
Object simple extend
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 (original, update) { | |
var rec = function(a, b) { | |
var i; | |
for (i in b) { | |
a[i] = b[i]; | |
} | |
return a; | |
}; | |
return rec(rec({}, original), update); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment