Skip to content

Instantly share code, notes, and snippets.

@barmao
Forked from JoaoCnh/map.js
Created August 9, 2018 13:52
Show Gist options
  • Select an option

  • Save barmao/38f5fad05de8efc8fc514dbbefa044eb to your computer and use it in GitHub Desktop.

Select an option

Save barmao/38f5fad05de8efc8fc514dbbefa044eb 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