Skip to content

Instantly share code, notes, and snippets.

@andycarrell
Last active June 13, 2017 23:48
Show Gist options
  • Save andycarrell/d9781ee7c8ffdb4e67bf917cd1b901f0 to your computer and use it in GitHub Desktop.
Save andycarrell/d9781ee7c8ffdb4e67bf917cd1b901f0 to your computer and use it in GitHub Desktop.
// Still not sure why object spread is not full spec...
const spread = (...objs) => Object.assign({}, ...objs);
const safeSpread = (...objs) => Object.assign({}, ...objs.map(o => o || {}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment