Object Creation Methods
What composition pattern is shown here?
const withLogging = (target) => ({
...target,
log(msg) { console.log(`[${target.name}]: ${msg}`); }
});
const withValidation = (target) => ({
...target,
validate() { return typeof target.name === 'string'; }
});
const user = withValidation(withLogging({ name: 'John' }));