Skip to content

Instantly share code, notes, and snippets.

@JoaoCnh
Created February 14, 2018 09:29
Show Gist options
  • Save JoaoCnh/33066830188c74eeae8f05b1a4674c2f to your computer and use it in GitHub Desktop.
Save JoaoCnh/33066830188c74eeae8f05b1a4674c2f to your computer and use it in GitHub Desktop.
javascript map 2nd example
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