Skip to content

Instantly share code, notes, and snippets.

@RyanCCollins
Created June 27, 2017 20:21
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 RyanCCollins/6755b6c52df2191aee01b1b173e9f290 to your computer and use it in GitHub Desktop.
Save RyanCCollins/6755b6c52df2191aee01b1b173e9f290 to your computer and use it in GitHub Desktop.
Object destructuring example:
// Using object de-structuring
// See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment
const albumSalesStrings = musicData.map(
({ album, artist, sales }) => `${album} by ${artist} sold ${sales} copies`
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment