Last active
May 15, 2019 20:43
-
-
Save hperantunes/7092dc6cfff9bee5ac8c897c349b8ce7 to your computer and use it in GitHub Desktop.
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
export const sumObjects = (first, second) => Object.keys(second).reduce((object, key) => ({ | |
...object, | |
[key]: (first[key] || 0) + (second[key] || 0) | |
}), {}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment