1. 1
    Shallow Merge Two Objects in JavaScript
    4m 4s

Shallow Merge Two Objects in JavaScript

InstructorChris Achard

Share this video with your friends

Send Tweet

This lesson looks at three methods that can be used to shallow merge two objects in javascript: Object.assign, both with mutating the original object and without mutation, and the spread operator.

It also covers the potential danger of doing a shallow merge instead of a deep merge, by showing an example of merging two objects that have objects as values, instead of simple strings.