Closed fokusferit closed 5 years ago
please use backticks () to
get code highlighting`
Your solution worked since:
["1","2","3"].toString()
returns
"1,2,3"
Here's your solution with a few comments showing how the data was transformed:
return movieLists.map(function(item){
return item.videos.map(function(video){
return {
id: video.id,
title: video.title,
boxart: video.boxarts.
filter(function(art){return (art.width === 150 && art.height === 200);}).
map(function(art){return art.url}).
// 👆 Map transforms an Array and returns an Array:
// [{ url: "str", ... }] -> ["str"]
toString()
// Calling `.toString()` here removes the square brackets `[]` to be "str"
};
});
}).concatAll();
and the comparison between the actual and expected results are performed by comparing the values as strings. Issue #7 suggests changing this behaviour.
I think you can close this one as a duplicate @morenoh149.
I've tried the following code:
I don't know if that should be allowed. I'm new to the whole functional paradigm and I guess this shouldn't be possible?
If not, it's maybe great to know another solution without a second inner .concatAll()