Last active
June 1, 2017 04:05
-
-
Save bryzettler/308ce221e5c5f8d9812bd48dafa981cd to your computer and use it in GitHub Desktop.
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
// item is named record for easily knowing what | |
// we're operating on | |
records.reduce((acc, record) => { | |
// Recored is not longer than 60 mins | |
// return acc as is, doing nothing with record (filter) | |
if (record.lengthSec > (60 * 60)) return acc; | |
// Destructure acc into new array | |
// Destructure record into new object and add display prop | |
return [ | |
...acc, | |
{ | |
...record, | |
['display']: `${record.artist} - ${record.title} (${record.released})` | |
} | |
] | |
}, []); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment