Created
October 24, 2020 14:31
-
-
Save Dunkelheit/96bfd77d1e7b80c71e2f0a94d3cb902a to your computer and use it in GitHub Desktop.
Deep object merging - 2
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
const lorem = { | |
ipsum: { | |
dolor: { | |
sit: 'amet' | |
} | |
} | |
}; | |
const foo = { | |
ipsum: { | |
dolor: { | |
sit: 'consectetur adipiscing' | |
} | |
} | |
}; | |
const merge = { | |
...lorem, | |
...foo | |
}; | |
console.log(merge); | |
// { | |
// ipsum: { | |
// dolor: { | |
// sit: 'consectetur adipiscing' | |
// } | |
// } | |
// } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment