Object.assign() copies enumerable own properties from one object onto another, which reads like a deep clone and is not one. Nested objects are copied by reference, so mutating the copy mutates the original — usually discovered when a “copy” of a config object turns out to be the same config object.
var defaults = { retries: 3, http: { timeout: 5000 } };
var options = Object.assign({}, defaults, { retries: 5 });
options.http.timeout = 200;
console.log(defaults.http.timeout); // 200 — same object
The first argument is the target and is modified in place, which is why the idiom starts with an empty object literal. It reached the spec this June; browser support is still uneven, so a polyfill or a build step is required for anything shipping to users today.