Created
August 16, 2018 10:56
-
-
Save rsolci/47ec5a1d7609561eb07973506f11f331 to your computer and use it in GitHub Desktop.
Replace all properties from targetO with values from sourceO, returning a new object.
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
Object.keys(targetO).reduce((memo, key)=>({ ...memo, [key]: key in sourceO ? sourceO[key] : targetO[key] }), {}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment