Created
June 27, 2017 20:21
-
-
Save RyanCCollins/6755b6c52df2191aee01b1b173e9f290 to your computer and use it in GitHub Desktop.
Object destructuring example:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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