Skip to content

Instantly share code, notes, and snippets.

@talitaoliveira
Created December 1, 2018 14:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save talitaoliveira/dd36fd8a9fb9b2973a73829a7f7a67d5 to your computer and use it in GitHub Desktop.
Save talitaoliveira/dd36fd8a9fb9b2973a73829a7f7a67d5 to your computer and use it in GitHub Desktop.
Using the new feature of ES9: Rest Properties for objects
/**
* REST PROPERTIES
* Using the REST operator "..." to extract properties from an object
* */
const { website, ...moreInfo } = {
website: 'http://rec.jsday.com.br/',
day: 1,
month: 12,
year: 2018,
location: 'Faculdade Imaculada conceição'
};
console.log(website); // http://rec.jsday.com.br/
console.log(moreInfo); // {day: 1, month: 12, location: "Faculdade Imaculada conceição"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment