When merging two objects in javascript, you can shallow merge them, or deep merge them. You can do it strictly through JavaScript or you can use a library such as Lodash and deepmerge to achieve your desired outcome. These videos show how to do both, and talk about the pros and cons of each approach.
Overview
Syllabus
- Shallow Merge Two Objects in JavaScript
- Deep Merge Objects in JavaScript with Spread, Lodash, and Deepmerge
Taught by
Chris Achard