Created
February 14, 2018 09:29
-
-
Save JoaoCnh/33066830188c74eeae8f05b1a4674c2f to your computer and use it in GitHub Desktop.
javascript map 2nd 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
const lowerCaseSongs = songs.map(mySongFunc); | |
var mySongFunc = function(song) { | |
return song.name.toLowerCase(); | |
}; | |
// ES6 | |
const mySongFunc = song => { | |
return song.name.toLowerCase(); | |
}; | |
console.log(lowerCaseSongs); // ["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