Last active
February 1, 2020 21:45
-
-
Save JoaoCnh/37ff889a755565ac3b971032b2e9a026 to your computer and use it in GitHub Desktop.
js map example
This file contains 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
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