Skip to content

Instantly share code, notes, and snippets.

@fport
Last active February 22, 2022 02:52
Show Gist options
  • Save fport/75a38a883b24834589882529e432862f to your computer and use it in GitHub Desktop.
Save fport/75a38a883b24834589882529e432862f to your computer and use it in GitHub Desktop.
mergeExistingObject
const mergeExistingObject = (source ,target) => {
return Object.keys(source)
.reduce((a, key) => ({ ...a, [key]: target[key]}), {});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment