In brief
The operation changes the target object and copies shallowly.
Useful to know
Object.assign() copies its own enumerable properties to a target object. In Object.assign({}, {mode: "light"}, {mode: "dark"}), the final mode is "dark". The later source overwrites the same key . [1]
An empty first object is a conscious choice if you don't want to change the first set of settings. The nested objects do not merge recursively and do not clone deeply. Before combining a configuration, decide whether the target is a shallow substitution or an actual aggregation of nested fields. Function names should reflect this difference.
Sources
For further detail and to check the information: