Skip to content

Instantly share code, notes, and snippets.

@Dunkelheit
Last active October 24, 2020 14:29
Show Gist options
  • Save Dunkelheit/bb43d3ed7030a3606906f52f08733c74 to your computer and use it in GitHub Desktop.
Save Dunkelheit/bb43d3ed7030a3606906f52f08733c74 to your computer and use it in GitHub Desktop.
Deep object merging - 1
const lorem = {
ipsum: {
dolor: {
sit: 'amet'
}
}
};
const foo = {
bar: 'baz'
};
const merge = {
...lorem,
...foo
};
console.log(merge);
// {
// ipsum: {
// dolor: {
// sit: 'amet'
// }
// },
// bar: 'baz'
// }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment