We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have solve exercise 26 in another way, like this:
lists.map((genre) => { return { name: genre.name, videos: videos.filter((video) => { return video.listId == genre.id; }).map((filtredVideo) => { return { id: filtredVideo.id, title: filtredVideo.title, time: bookmarks.filter((bookmark) => { return bookmark.videoId == filtredVideo.id; }).map((filtredBookmark) => { return filtredBookmark.time; })[0], boxart: boxarts.filter((boxart) => { return boxart.videoId == filtredVideo.id; }).reduce((fBoxart1, fBoxart2) => { return fBoxart1.width * fBoxart1.height > fBoxart2.width * fBoxart2.height ? fBoxart2 : fBoxart1; }).map((filtredReducedBoxart) => { return filtredReducedBoxart.url; })[0] }; }) }; });
It's a little bit different form original code:
lists.map(function(list) { return { name: list.name, videos: videos. filter(function(video) { return video.listId === list.id; }). concatMap(function(video) { return Array.zip( bookmarks.filter(function(bookmark) { return bookmark.videoId === video.id; }), boxarts.filter(function(boxart) { return boxart.videoId === video.id; }). reduce(function(acc,curr) { return acc.width * acc.height < curr.width * curr.height ? acc : curr; }), function(bookmark, boxart) { return { id: video.id, title: video.title, time: bookmark.time, boxart: boxart.url }; }); }) }; });
So please tell me... Do my solution is good? If not, why? Maybe it's not "functional thinking"?
And I act like in the first option all time, that how I'm thinking - it's seems simpler for me.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have solve exercise 26 in another way, like this:
It's a little bit different form original code:
So please tell me... Do my solution is good? If not, why? Maybe it's not "functional thinking"?
And I act like in the first option all time, that how I'm thinking - it's seems simpler for me.
The text was updated successfully, but these errors were encountered: