Created
April 22, 2019 13:14
-
-
Save mhairston/161d307701ca9ec4c740fc8e014017b3 to your computer and use it in GitHub Desktop.
Extend JS object
This file contains 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
// from https://plainjs.com/javascript/utilities/merge-two-javascript-objects-19/ | |
function extend(obj, src) { | |
Object.keys(src).forEach(function(key) { obj[key] = src[key]; }); | |
return obj; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment