Skip to content

Instantly share code, notes, and snippets.

@JoaoCnh
Last active February 1, 2020 21:45
Show Gist options
  • Save JoaoCnh/37ff889a755565ac3b971032b2e9a026 to your computer and use it in GitHub Desktop.
Save JoaoCnh/37ff889a755565ac3b971032b2e9a026 to your computer and use it in GitHub Desktop.
js map example
var allSongNames = songs.map(function (song) {
return song.name;
});
// ES6
const allSongNames = songs.map(song => {
return song.name;
});
console.log(allSongNames); // ["Curl of the Burl","Oblivion","Flying Whales","L'Enfant Sauvage"];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment