Skip to content

Instantly share code, notes, and snippets.

@fabriciofmsilva
Last active February 6, 2018 20:39
Show Gist options
  • Save fabriciofmsilva/929da7414b515b9d713b157c9f6117b3 to your computer and use it in GitHub Desktop.
Save fabriciofmsilva/929da7414b515b9d713b157c9f6117b3 to your computer and use it in GitHub Desktop.
Rest spread in object properties in ES2018
let { a, ...b } = { a: 'JS', x: 1, y: 2 };
a; // JS
b; // { x: 1, y: 2 }
let n = { a, ...b }
n; // { a: 'JS', x: 1, y: 2 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment