Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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