-
-
Save genpri/2bc35a41c24c843097554771f9c9c29a to your computer and use it in GitHub Desktop.
Revisions
-
JoaoCnh revised this gist
Feb 14, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ const songNames = allSongs.reduce((acc, currValue) => { }) // Let's filter the ones under 3 minutes .filter(song => { return song.duration > 3; }) // Now let's map out the song names the quick way .map(song => song.name).join(" , "); -
JoaoCnh created this gist
Feb 14, 2018 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ // Let's reduce the array of arrays into a single one const songNames = allSongs.reduce((acc, currValue) => { return acc.concat(currValue); }, []) // Let's map it out with the seconds turned into minutes .map(song => { return { ...song, duration: Math.floor(song.duration / 60) }; }) // Let's filter the ones under 3 minutes .filter(song => { return song.duration >= 3; }) // Now let's map out the song names the quick way .map(song => song.name).join(" , "); console.log(songNames); // Oblivion , Flying Whales , L'Enfant Sauvage , Out of the Black