Object.assignintermediate// Merge source into target
const target = { a: 1 }
Object.assign(target, { b: 2 }) // β { a: 1, b: 2 }Use Object.assign() to copy properties from one or more source objects into a target object.
A common pattern is to merge user-supplied options over a defaults object, so any missing keys fall back to their default values.
Challenge: Implement applyDefaults(defaults, overrides) that returns a new object with defaults applied, then overridden by overrides.
applyDefaults({ color: 'red', size: 'M' }, { color: 'blue' })
// β { color: 'blue', size: 'M' }