Copy properties from one object to another:
let defaults = { color: "blue", size: "medium" }
let options = { size: "large" }
let merged = Object.assign({}, defaults, options)
console.log(merged) // { color: "blue", size: "large" }
Later sources override earlier ones. The first argument is the target (use {} for a new object). Object.assign modifies and returns the target.