Created
July 27, 2016 20:03
-
-
Save ti0ma/db0038a39092a973ce861a9deb98befe 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
{"answers":["function(console) {\n\tvar names = [\"Ben\", \"Jafar\", \"Matt\", \"Priya\", \"Brian\"],\n\t\tcounter;\n\n\tfor(counter = 0; counter < names.length; counter++) {\n\t\tconsole.log(names[counter]);\n\t}\n}\n\t\t","function(console) {\n\tvar names = [\"Ben\", \"Jafar\", \"Matt\", \"Priya\", \"Brian\"];\n\n\tnames.forEach(function(name) {\n\t\tconsole.log(name);\n\t});\n}\n\t\t","function() {\n\tvar newReleases = [\n\t\t{\n\t\t\t\"id\": 70111470,\n\t\t\t\"title\": \"Die Hard\",\n\t\t\t\"boxart\": \"http://cdn-0.nflximg.com/images/2891/DieHard.jpg\",\n\t\t\t\"uri\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\"rating\": [4.0],\n\t\t\t\"bookmark\": []\n\t\t},\n\t\t{\n\t\t\t\"id\": 654356453,\n\t\t\t\"title\": \"Bad Boys\",\n\t\t\t\"boxart\": \"http://cdn-0.nflximg.com/images/2891/BadBoys.jpg\",\n\t\t\t\"uri\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\"rating\": [5.0],\n\t\t\t\"bookmark\": [{ id: 432534, time: 65876586 }]\n\t\t},\n\t\t{\n\t\t\t\"id\": 65432445,\n\t\t\t\"title\": \"The Chamber\",\n\t\t\t\"boxart\": \"http://cdn-0.nflximg.com/images/2891/TheChamber.jpg\",\n\t\t\t\"uri\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\"rating\": [4.0],\n\t\t\t\"bookmark\": []\n\t\t},\n\t\t{\n\t\t\t\"id\": 675465,\n\t\t\t\"title\": \"Fracture\",\n\t\t\t\"boxart\": \"http://cdn-0.nflximg.com/images/2891/Fracture.jpg\",\n\t\t\t\"uri\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\"rating\": [5.0],\n\t\t\t\"bookmark\": [{ id: 432534, time: 65876586 }]\n\t\t}\n\t],\n\tvideoAndTitlePairs = [];\n\n\t// ------------ INSERT CODE HERE! -----------------------------------\n\t// Use forEach function to accumulate {id, title} pairs from each video.\n\t// Put the results into the videoAndTitlePairs array using the Array's\n\t// push() method. Example: videoAndTitlePairs.push(newItem);\n\t// ------------ INSERT CODE HERE! -----------------------------------\n newReleases.forEach(({id, title}) => videoAndTitlePairs.push({id, title}));\n\tconsole.log(videoAndTitlePairs);\n\treturn videoAndTitlePairs;\n}\n\t\t","Array.prototype.map = function(projectionFunction) {\n\tvar results = [];\n\tthis.forEach(function(itemInArray) {\n\t\t\n\t\t// ------------ INSERT CODE HERE! ----------------------------\n\t\t// Apply the projectionFunction to each item in the array and add\n\t\t// each result to the results array.\n\t\t// Note: you can add items to an array with the push() method.\n\t\t// ------------ INSERT CODE HERE! ----------------------------\n\t\tresults.push(projectionFunction(itemInArray));\n\t});\n\n\treturn results;\n};\n\n// JSON.stringify([1,2,3].map(function(x) { return x + 1; })) === '[2,3,4]'\n\t\t","function() {\n\tvar newReleases = [\n\t\t\t{\n\t\t\t\t\"id\": 70111470,\n\t\t\t\t\"title\": \"Die Hard\",\n\t\t\t\t\"boxart\": \"http://cdn-0.nflximg.com/images/2891/DieHard.jpg\",\n\t\t\t\t\"uri\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\"rating\": [4.0],\n\t\t\t\t\"bookmark\": []\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"id\": 654356453,\n\t\t\t\t\"title\": \"Bad Boys\",\n\t\t\t\t\"boxart\": \"http://cdn-0.nflximg.com/images/2891/BadBoys.jpg\",\n\t\t\t\t\"uri\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\"rating\": [5.0],\n\t\t\t\t\"bookmark\": [{ id: 432534, time: 65876586 }]\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"id\": 65432445,\n\t\t\t\t\"title\": \"The Chamber\",\n\t\t\t\t\"boxart\": \"http://cdn-0.nflximg.com/images/2891/TheChamber.jpg\",\n\t\t\t\t\"uri\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\"rating\": [4.0],\n\t\t\t\t\"bookmark\": []\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"id\": 675465,\n\t\t\t\t\"title\": \"Fracture\",\n\t\t\t\t\"boxart\": \"http://cdn-0.nflximg.com/images/2891/Fracture.jpg\",\n\t\t\t\t\"uri\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\"rating\": [5.0],\n\t\t\t\t\"bookmark\": [{ id: 432534, time: 65876586 }]\n\t\t\t}\n\t\t];\n\n return newReleases.map(({id, title}) => {\n return {id, title}\n });\n}\n\t\t","function() {\n\tvar newReleases = [\n\t\t{\n\t\t\t\"id\": 70111470,\n\t\t\t\"title\": \"Die Hard\",\n\t\t\t\"boxart\": \"http://cdn-0.nflximg.com/images/2891/DieHard.jpg\",\n\t\t\t\"uri\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\"rating\": 4.0,\n\t\t\t\"bookmark\": []\n\t\t},\n\t\t{\n\t\t\t\"id\": 654356453,\n\t\t\t\"title\": \"Bad Boys\",\n\t\t\t\"boxart\": \"http://cdn-0.nflximg.com/images/2891/BadBoys.jpg\",\n\t\t\t\"uri\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\"rating\": 5.0,\n\t\t\t\"bookmark\": [{ id: 432534, time: 65876586 }]\n\t\t},\n\t\t{\n\t\t\t\"id\": 65432445,\n\t\t\t\"title\": \"The Chamber\",\n\t\t\t\"boxart\": \"http://cdn-0.nflximg.com/images/2891/TheChamber.jpg\",\n\t\t\t\"uri\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\"rating\": 4.0,\n\t\t\t\"bookmark\": []\n\t\t},\n\t\t{\n\t\t\t\"id\": 675465,\n\t\t\t\"title\": \"Fracture\",\n\t\t\t\"boxart\": \"http://cdn-0.nflximg.com/images/2891/Fracture.jpg\",\n\t\t\t\"uri\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\"rating\": 5.0,\n\t\t\t\"bookmark\": [{ id: 432534, time: 65876586 }]\n\t\t}\n\t],\n\tvideos = [];\n\n\t// ------------ INSERT CODE HERE! -----------------------------------\n\t// Use forEach function to accumulate every video with a rating of 5.0\n\t// ------------ INSERT CODE HERE! -----------------------------------\n newReleases.forEach(video => {\n if(video.rating === 5.0) {\n videos.push(video);\n }\n });\n\treturn videos;\n}\n\t\t","Array.prototype.filter = function(predicateFunction) {\n\tvar results = [];\n\tthis.forEach(function(itemInArray) {\n\t\t// ------------ INSERT CODE HERE! ----------------------------\n\t\t// Apply the predicateFunction to each item in the array.\n\t\t// If the result is truthy, add the item to the results array.\n\t\t// Note: remember you can add items to the array using the array's\n\t\t// push() method.\n\t\t// ------------ INSERT CODE HERE! ----------------------------\n if(predicateFunction(itemInArray)) {\n results.push(itemInArray);\n }\n\t});\n\n\treturn results;\n};\n\n// JSON.stringify([1,2,3].filter(function(x) { return x > 2})) === \"[3]\"\n\t\t","function() {\n\tvar newReleases = [\n\t\t{\n\t\t\t\"id\": 70111470,\n\t\t\t\"title\": \"Die Hard\",\n\t\t\t\"boxart\": \"http://cdn-0.nflximg.com/images/2891/DieHard.jpg\",\n\t\t\t\"uri\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\"rating\": 4.0,\n\t\t\t\"bookmark\": []\n\t\t},\n\t\t{\n\t\t\t\"id\": 654356453,\n\t\t\t\"title\": \"Bad Boys\",\n\t\t\t\"boxart\": \"http://cdn-0.nflximg.com/images/2891/BadBoys.jpg\",\n\t\t\t\"uri\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\"rating\": 5.0,\n\t\t\t\"bookmark\": [{ id: 432534, time: 65876586 }]\n\t\t},\n\t\t{\n\t\t\t\"id\": 65432445,\n\t\t\t\"title\": \"The Chamber\",\n\t\t\t\"boxart\": \"http://cdn-0.nflximg.com/images/2891/TheChamber.jpg\",\n\t\t\t\"uri\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\"rating\": 4.0,\n\t\t\t\"bookmark\": []\n\t\t},\n\t\t{\n\t\t\t\"id\": 675465,\n\t\t\t\"title\": \"Fracture\",\n\t\t\t\"boxart\": \"http://cdn-0.nflximg.com/images/2891/Fracture.jpg\",\n\t\t\t\"uri\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\"rating\": 5.0,\n\t\t\t\"bookmark\": [{ id: 432534, time: 65876586 }]\n\t\t}\n\t];\n\n\t// ------------ INSERT CODE HERE! -----------------------------------\n\t// Chain the filter and map functions to select the id of all videos\n\t// with a rating of 5.0.\n\n\treturn newReleases.filter(x => x.rating === 5.0).map(vid => vid.id) // Complete this expression\n\t// ------------ INSERT CODE HERE! -----------------------------------\n}\n\t\t","function() {\n\tvar movieLists = [\n\t\t{\n\t\t\tname: \"New Releases\",\n\t\t\tvideos: [\n\t\t\t\t{\n\t\t\t\t\t\"id\": 70111470,\n\t\t\t\t\t\"title\": \"Die Hard\",\n\t\t\t\t\t\"boxart\": \"http://cdn-0.nflximg.com/images/2891/DieHard.jpg\",\n\t\t\t\t\t\"uri\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\t\"rating\": 4.0,\n\t\t\t\t\t\"bookmark\": []\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"id\": 654356453,\n\t\t\t\t\t\"title\": \"Bad Boys\",\n\t\t\t\t\t\"boxart\": \"http://cdn-0.nflximg.com/images/2891/BadBoys.jpg\",\n\t\t\t\t\t\"uri\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\t\"rating\": 5.0,\n\t\t\t\t\t\"bookmark\": [{ id: 432534, time: 65876586 }]\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\tname: \"Dramas\",\n\t\t\tvideos: [\n\t\t\t\t{\n\t\t\t\t\t\"id\": 65432445,\n\t\t\t\t\t\"title\": \"The Chamber\",\n\t\t\t\t\t\"boxart\": \"http://cdn-0.nflximg.com/images/2891/TheChamber.jpg\",\n\t\t\t\t\t\"uri\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\t\"rating\": 4.0,\n\t\t\t\t\t\"bookmark\": []\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"id\": 675465,\n\t\t\t\t\t\"title\": \"Fracture\",\n\t\t\t\t\t\"boxart\": \"http://cdn-0.nflximg.com/images/2891/Fracture.jpg\",\n\t\t\t\t\t\"uri\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\t\"rating\": 5.0,\n\t\t\t\t\t\"bookmark\": [{ id: 432534, time: 65876586 }]\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t],\n\tallVideoIdsInMovieLists = [];\n\n\t// ------------ INSERT CODE HERE! -----------------------------------\n\t// Use two nested forEach loops to flatten the movieLists into a list of\n\t// video ids.\n\t// ------------ INSERT CODE HERE! -----------------------------------\n\tmovieLists.forEach(rate => rate.videos.forEach(video => allVideoIdsInMovieLists.push(video.id)));\n\treturn allVideoIdsInMovieLists;\n\n}\n\t\t","Array.prototype.concatAll = function() {\n\tvar results = [];\n\tthis.forEach(function(subArray) {\n\t\t// ------------ INSERT CODE HERE! ----------------------------\n\t\t// Add all the items in each subArray to the results array.\n\t\t// ------------ INSERT CODE HERE! ----------------------------\n subArray.forEach(res => results.push(res));\n\t});\n\n\treturn results;\n};\n\n// JSON.stringify([ [1,2,3], [4,5,6], [7,8,9] ].concatAll()) === \"[1,2,3,4,5,6,7,8,9]\"\n// [1,2,3].concatAll(); // throws an error because this is a one-dimensional array\n\t\t","function() {\n\tvar movieLists = [\n\t\t\t{\n\t\t\t\tname: \"New Releases\",\n\t\t\t\tvideos: [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"id\": 70111470,\n\t\t\t\t\t\t\"title\": \"Die Hard\",\n\t\t\t\t\t\t\"boxart\": \"http://cdn-0.nflximg.com/images/2891/DieHard.jpg\",\n\t\t\t\t\t\t\"uri\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\t\t\"rating\": 4.0,\n\t\t\t\t\t\t\"bookmark\": []\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"id\": 654356453,\n\t\t\t\t\t\t\"title\": \"Bad Boys\",\n\t\t\t\t\t\t\"boxart\": \"http://cdn-0.nflximg.com/images/2891/BadBoys.jpg\",\n\t\t\t\t\t\t\"uri\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\t\t\"rating\": 5.0,\n\t\t\t\t\t\t\"bookmark\": [{ id: 432534, time: 65876586 }]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: \"Dramas\",\n\t\t\t\tvideos: [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"id\": 65432445,\n\t\t\t\t\t\t\"title\": \"The Chamber\",\n\t\t\t\t\t\t\"boxart\": \"http://cdn-0.nflximg.com/images/2891/TheChamber.jpg\",\n\t\t\t\t\t\t\"uri\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\t\t\"rating\": 4.0,\n\t\t\t\t\t\t\"bookmark\": []\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"id\": 675465,\n\t\t\t\t\t\t\"title\": \"Fracture\",\n\t\t\t\t\t\t\"boxart\": \"http://cdn-0.nflximg.com/images/2891/Fracture.jpg\",\n\t\t\t\t\t\t\"uri\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\t\t\"rating\": 5.0,\n\t\t\t\t\t\t\"bookmark\": [{ id: 432534, time: 65876586 }]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t];\n\n\t// ------------ INSERT CODE HERE! -----------------------------------\n\t// Use map and concatAll to flatten the movieLists in a list of video ids.\n\t// ------------ INSERT CODE HERE! -----------------------------------\n\n\treturn movieLists.map(item => item.videos.map(video => video.id)).concatAll(); // Complete this expression!\n\n}\n\t\t","function() {\n\tvar movieLists = [\n\t\t\t{\n\t\t\t\tname: \"Instant Queue\",\n\t\t\t\tvideos : [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"id\": 70111470,\n\t\t\t\t\t\t\"title\": \"Die Hard\",\n\t\t\t\t\t\t\"boxarts\": [\n\t\t\t\t\t\t\t{ width: 150, height: 200, url: \"http://cdn-0.nflximg.com/images/2891/DieHard150.jpg\" },\n\t\t\t\t\t\t\t{ width: 200, height: 200, url: \"http://cdn-0.nflximg.com/images/2891/DieHard200.jpg\" }\n\t\t\t\t\t\t],\n\t\t\t\t\t\t\"url\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\t\t\"rating\": 4.0,\n\t\t\t\t\t\t\"bookmark\": []\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"id\": 654356453,\n\t\t\t\t\t\t\"title\": \"Bad Boys\",\n\t\t\t\t\t\t\"boxarts\": [\n\t\t\t\t\t\t\t{ width: 200, height: 200, url: \"http://cdn-0.nflximg.com/images/2891/BadBoys200.jpg\" },\n\t\t\t\t\t\t\t{ width: 150, height: 200, url: \"http://cdn-0.nflximg.com/images/2891/BadBoys150.jpg\" }\n\n\t\t\t\t\t\t],\n\t\t\t\t\t\t\"url\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\t\t\"rating\": 5.0,\n\t\t\t\t\t\t\"bookmark\": [{ id: 432534, time: 65876586 }]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: \"New Releases\",\n\t\t\t\tvideos: [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"id\": 65432445,\n\t\t\t\t\t\t\"title\": \"The Chamber\",\n\t\t\t\t\t\t\"boxarts\": [\n\t\t\t\t\t\t\t{ width: 150, height: 200, url: \"http://cdn-0.nflximg.com/images/2891/TheChamber150.jpg\" },\n\t\t\t\t\t\t\t{ width: 200, height: 200, url: \"http://cdn-0.nflximg.com/images/2891/TheChamber200.jpg\" }\n\t\t\t\t\t\t],\n\t\t\t\t\t\t\"url\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\t\t\"rating\": 4.0,\n\t\t\t\t\t\t\"bookmark\": []\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"id\": 675465,\n\t\t\t\t\t\t\"title\": \"Fracture\",\n\t\t\t\t\t\t\"boxarts\": [\n\t\t\t\t\t\t\t{ width: 200, height: 200, url: \"http://cdn-0.nflximg.com/images/2891/Fracture200.jpg\" },\n\t\t\t\t\t\t\t{ width: 150, height: 200, url: \"http://cdn-0.nflximg.com/images/2891/Fracture150.jpg\" },\n\t\t\t\t\t\t\t{ width: 300, height: 200, url: \"http://cdn-0.nflximg.com/images/2891/Fracture300.jpg\" }\n\t\t\t\t\t\t],\n\t\t\t\t\t\t\"url\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\t\t\"rating\": 5.0,\n\t\t\t\t\t\t\"bookmark\": [{ id: 432534, time: 65876586 }]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t];\n\n\n\t// Use one or more map, concatAll, and filter calls to create an array with the following items\n\t// [\n\t//\t {\"id\": 675465,\"title\": \"Fracture\",\"boxart\":\"http://cdn-0.nflximg.com/images/2891/Fracture150.jpg\" },\n\t//\t {\"id\": 65432445,\"title\": \"The Chamber\",\"boxart\":\"http://cdn-0.nflximg.com/images/2891/TheChamber150.jpg\" },\n\t//\t {\"id\": 654356453,\"title\": \"Bad Boys\",\"boxart\":\"http://cdn-0.nflximg.com/images/2891/BadBoys150.jpg\" },\n\t//\t {\"id\": 70111470,\"title\": \"Die Hard\",\"boxart\":\"http://cdn-0.nflximg.com/images/2891/DieHard150.jpg\" }\n\t// ];\n\n\treturn movieLists\n .map(item => item.videos)\n .concatAll()\n .map(item => {\n return item.boxarts\n \t.filter(boxart => boxart.width === 150)\n .map(boxart => {return {\n id: item.id,\n title: item.title,\n boxart: boxart.url\n }})\n \n \t}).concatAll()\n\n}\n\t\t","Array.prototype.concatMap = function(projectionFunctionThatReturnsArray) {\n\treturn this.\n\t\tmap(function(item) {\n return projectionFunctionThatReturnsArray(item);\n\t\t\t// ------------ INSERT CODE HERE! ----------------------------\n\t\t\t// Apply the projection function to each item. The projection\n\t\t\t// function will return an new child array. This will create a\n\t\t\t// two-dimensional array.\n\t\t\t// ------------ INSERT CODE HERE! ----------------------------\n\t\t}).\n\t\t// apply the concatAll function to flatten the two-dimensional array\n\t\tconcatAll();\n};\n\n/*\n\tvar spanishFrenchEnglishWords = [ [\"cero\",\"rien\",\"zero\"], [\"uno\",\"un\",\"one\"], [\"dos\",\"deux\",\"two\"] ];\n\t// collect all the words for each number, in every language, in a single, flat list\n\tvar allWords = [0,1,2].\n\t\tconcatMap(function(index) {\n\t\t\treturn spanishFrenchEnglishWords[index];\n\t\t});\n\n\treturn JSON.stringify(allWords) === '[\"cero\",\"rien\",\"zero\",\"uno\",\"un\",\"one\",\"dos\",\"deux\",\"two\"]';\n*/\n\t\t","function() {\n\tvar movieLists = [\n\t\t\t{\n\t\t\t\tname: \"Instant Queue\",\n\t\t\t\tvideos : [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"id\": 70111470,\n\t\t\t\t\t\t\"title\": \"Die Hard\",\n\t\t\t\t\t\t\"boxarts\": [\n\t\t\t\t\t\t\t{ width: 150, height: 200, url: \"http://cdn-0.nflximg.com/images/2891/DieHard150.jpg\" },\n\t\t\t\t\t\t\t{ width: 200, height: 200, url: \"http://cdn-0.nflximg.com/images/2891/DieHard200.jpg\" }\n\t\t\t\t\t\t],\n\t\t\t\t\t\t\"url\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\t\t\"rating\": 4.0,\n\t\t\t\t\t\t\"bookmark\": []\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"id\": 654356453,\n\t\t\t\t\t\t\"title\": \"Bad Boys\",\n\t\t\t\t\t\t\"boxarts\": [\n\t\t\t\t\t\t\t{ width: 200, height: 200, url: \"http://cdn-0.nflximg.com/images/2891/BadBoys200.jpg\" },\n\t\t\t\t\t\t\t{ width: 150, height: 200, url: \"http://cdn-0.nflximg.com/images/2891/BadBoys150.jpg\" }\n\n\t\t\t\t\t\t],\n\t\t\t\t\t\t\"url\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\t\t\"rating\": 5.0,\n\t\t\t\t\t\t\"bookmark\": [{ id: 432534, time: 65876586 }]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: \"New Releases\",\n\t\t\t\tvideos: [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"id\": 65432445,\n\t\t\t\t\t\t\"title\": \"The Chamber\",\n\t\t\t\t\t\t\"boxarts\": [\n\t\t\t\t\t\t\t{ width: 150, height: 200, url: \"http://cdn-0.nflximg.com/images/2891/TheChamber150.jpg\" },\n\t\t\t\t\t\t\t{ width: 200, height: 200, url: \"http://cdn-0.nflximg.com/images/2891/TheChamber200.jpg\" }\n\t\t\t\t\t\t],\n\t\t\t\t\t\t\"url\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\t\t\"rating\": 4.0,\n\t\t\t\t\t\t\"bookmark\": []\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"id\": 675465,\n\t\t\t\t\t\t\"title\": \"Fracture\",\n\t\t\t\t\t\t\"boxarts\": [\n\t\t\t\t\t\t\t{ width: 200, height: 200, url: \"http://cdn-0.nflximg.com/images/2891/Fracture200.jpg\" },\n\t\t\t\t\t\t\t{ width: 150, height: 200, url: \"http://cdn-0.nflximg.com/images/2891/Fracture150.jpg\" },\n\t\t\t\t\t\t\t{ width: 300, height: 200, url: \"http://cdn-0.nflximg.com/images/2891/Fracture300.jpg\" }\n\t\t\t\t\t\t],\n\t\t\t\t\t\t\"url\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\t\t\"rating\": 5.0,\n\t\t\t\t\t\t\"bookmark\": [{ id: 432534, time: 65876586 }]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t];\n\n\n\t// Use one or more concatMap, map, and filter calls to create an array with the following items\n\t// [\n\t//\t {\"id\": 675465, \"title\": \"Fracture\", \"boxart\": \"http://cdn-0.nflximg.com/images/2891/Fracture150.jpg\" },\n\t//\t {\"id\": 65432445, \"title\": \"The Chamber\", \"boxart\": \"http://cdn-0.nflximg.com/images/2891/TheChamber150.jpg\" },\n\t//\t {\"id\": 654356453, \"title\": \"Bad Boys\", \"boxart\": \"http://cdn-0.nflximg.com/images/2891/BadBoys150.jpg\" },\n\t//\t {\"id\": 70111470, \"title\": \"Die Hard\", \"boxart\": \"http://cdn-0.nflximg.com/images/2891/DieHard150.jpg\" }\n\t// ];\n\n\treturn movieLists\n .concatMap(item => item.videos)\n .concatMap(item => {\n return item.boxarts\n \t.filter(boxart => boxart.width === 150)\n \t\t\t.map(boxart => {return {\n id: item.id,\n title: item.title,\n boxart: boxart.url\n \t}})\n })\n // Complete this expression!\n\n}\n\t\t","function() {\n\tvar boxarts = [\n\t\t\t{ width: 200, height: 200, url: \"http://cdn-0.nflximg.com/images/2891/Fracture200.jpg\" },\n\t\t\t{ width: 150, height: 200, url: \"http://cdn-0.nflximg.com/images/2891/Fracture150.jpg\" },\n\t\t\t{ width: 300, height: 200, url: \"http://cdn-0.nflximg.com/images/2891/Fracture300.jpg\" },\n\t\t\t{ width: 425, height: 150, url: \"http://cdn-0.nflximg.com/images/2891/Fracture425.jpg\" }\n\t\t],\n\t\tcurrentSize,\n\t\tmaxSize = -1,\n\t\tlargestBoxart;\n\n\tboxarts.forEach(function(boxart) {\n\t\tcurrentSize = boxart.width * boxart.height;\n\t\tif (currentSize > maxSize) {\n\t\t\tlargestBoxart = boxart;\n\t\t\tmaxSize = currentSize;\n\t\t}\n\t});\n\n\treturn largestBoxart;\n}\n\t\t","// [1,2,3].reduce(function(accumulatedValue, currentValue) { return accumulatedValue + currentValue; }); === [6];\n// [1,2,3].reduce(function(accumulatedValue, currentValue) { return accumulatedValue + currentValue; }, 10); === [16];\n\nArray.prototype.reduce = function(combiner, initialValue) {\n\tvar counter,\n\t\taccumulatedValue;\n\n\t// If the array is empty, do nothing\n\tif (this.length === 0) {\n\t\treturn this;\n\t}\n\telse {\n\t\t// If the user didn't pass an initial value, use the first item.\n\t\tif (arguments.length === 1) {\n\t\t\tcounter = 1;\n\t\t\taccumulatedValue = this[0];\n\t\t}\n\t\telse if (arguments.length >= 2) {\n\t\t\tcounter = 0;\n\t\t\taccumulatedValue = initialValue;\n\t\t}\n\t\telse {\n\t\t\tthrow \"Invalid arguments.\";\n\t\t}\n\n\t\t// Loop through the array, feeding the current value and the result of\n\t\t// the previous computation back into the combiner function until\n\t\t// we've exhausted the entire array and are left with only one value.\n\t\twhile(counter < this.length) {\n\t\t\taccumulatedValue = combiner(accumulatedValue, this[counter])\n\t\t\tcounter++;\n\t\t}\n\n\t\treturn [accumulatedValue];\n\t}\n};\n\t\t","function() {\n\tvar ratings = [2,3,1,4,5];\n\n\t// You should return an array containing only the largest rating. Remember that reduce always\n\t// returns an array with one item.\n\treturn ratings.\n reduce(function(acc, curr) {\n if(curr > acc) {\n\t\t\t\treturn curr;\n }\n return acc;\n }) // Complete this expression\n}\n\t\t","function() {\n\tvar boxarts = [\n\t\t\t{ width: 200, height: 200, url: \"http://cdn-0.nflximg.com/images/2891/Fracture200.jpg\" },\n\t\t\t{ width: 150, height: 200, url: \"http://cdn-0.nflximg.com/images/2891/Fracture150.jpg\" },\n\t\t\t{ width: 300, height: 200, url: \"http://cdn-0.nflximg.com/images/2891/Fracture300.jpg\" },\n\t\t\t{ width: 425, height: 150, url: \"http://cdn-0.nflximg.com/images/2891/Fracture425.jpg\" }\n\t\t];\n\n\t// You should return an array containing only the URL of the largest box art. Remember that reduce always\n\t// returns an array with one item.\n\treturn boxarts.\n reduce(function(acc, curr) {\n var sizeAcc = acc.width * acc.height;\n var sizeCurr = curr.width * acc.height;\n \n if(sizeAcc < sizeCurr) {\n return curr;\n }\n return acc;\n }).map(img => img.url); // Complete this expression\n}\n\t\t","function() {\n\tvar videos = [\n\t\t{\n\t\t\t\"id\": 65432445,\n\t\t\t\"title\": \"The Chamber\"\n\t\t},\n\t\t{\n\t\t\t\"id\": 675465,\n\t\t\t\"title\": \"Fracture\"\n\t\t},\n\t\t{\n\t\t\t\"id\": 70111470,\n\t\t\t\"title\": \"Die Hard\"\n\t\t},\n\t\t{\n\t\t\t\"id\": 654356453,\n\t\t\t\"title\": \"Bad Boys\"\n\t\t}\n\t];\n\n\t// Expecting this output...\n\t// [\n\t//\t {\n\t//\t\t \"65432445\": \"The Chamber\",\n\t//\t\t \"675465\": \"Fracture\",\n\t//\t\t \"70111470\": \"Die Hard\",\n\t//\t\t \"654356453\": \"Bad Boys\"\n\t//\t }\n\t// ]\n\treturn videos.\n\t\treduce(function(accumulatedMap, video) {\n\t\tvar obj = {};\n\n\t\t// ----- INSERT CODE TO ADD THE VIDEO TITLE TO THE ----\n\t\t// ----- NEW MAP USING THE VIDEO ID AS THE KEY\t ----\n obj[video.id] = video.title;\n\n\t\t// Object.assign() takes all of the enumerable properties from\n\t\t// the object listed in its second argument (obj) and assigns them\n\t\t// to the object listed in its first argument (accumulatedMap).\n\t\treturn Object.assign(accumulatedMap, obj);\n\t\t},\n\t\t// Use an empty map as the initial value instead of the first item in\n\t\t// the list.\n\t\t{});\n}\n\t\t","function() {\n\tvar movieLists = [\n\t\t{\n\t\t\tname: \"New Releases\",\n\t\t\tvideos: [\n\t\t\t\t{\n\t\t\t\t\t\"id\": 70111470,\n\t\t\t\t\t\"title\": \"Die Hard\",\n\t\t\t\t\t\"boxarts\": [\n\t\t\t\t\t\t{ width: 150, height:200, url:\"http://cdn-0.nflximg.com/images/2891/DieHard150.jpg\" },\n\t\t\t\t\t\t{ width: 200, height:200, url:\"http://cdn-0.nflximg.com/images/2891/DieHard200.jpg\" }\n\t\t\t\t\t],\n\t\t\t\t\t\"url\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\t\"rating\": 4.0,\n\t\t\t\t\t\"bookmark\": []\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"id\": 654356453,\n\t\t\t\t\t\"title\": \"Bad Boys\",\n\t\t\t\t\t\"boxarts\": [\n\t\t\t\t\t\t{ width: 200, height:200, url:\"http://cdn-0.nflximg.com/images/2891/BadBoys200.jpg\" },\n\t\t\t\t\t\t{ width: 140, height:200, url:\"http://cdn-0.nflximg.com/images/2891/BadBoys140.jpg\" }\n\n\t\t\t\t\t],\n\t\t\t\t\t\"url\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\t\"rating\": 5.0,\n\t\t\t\t\t\"bookmark\": [{ id:432534, time:65876586 }]\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\tname: \"Thrillers\",\n\t\t\tvideos: [\n\t\t\t\t{\n\t\t\t\t\t\"id\": 65432445,\n\t\t\t\t\t\"title\": \"The Chamber\",\n\t\t\t\t\t\"boxarts\": [\n\t\t\t\t\t\t{ width: 130, height:200, url:\"http://cdn-0.nflximg.com/images/2891/TheChamber130.jpg\" },\n\t\t\t\t\t\t{ width: 200, height:200, url:\"http://cdn-0.nflximg.com/images/2891/TheChamber200.jpg\" }\n\t\t\t\t\t],\n\t\t\t\t\t\"url\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\t\"rating\": 4.0,\n\t\t\t\t\t\"bookmark\": []\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"id\": 675465,\n\t\t\t\t\t\"title\": \"Fracture\",\n\t\t\t\t\t\"boxarts\": [\n\t\t\t\t\t\t{ width: 200, height:200, url:\"http://cdn-0.nflximg.com/images/2891/Fracture200.jpg\" },\n\t\t\t\t\t\t{ width: 120, height:200, url:\"http://cdn-0.nflximg.com/images/2891/Fracture120.jpg\" },\n\t\t\t\t\t\t{ width: 300, height:200, url:\"http://cdn-0.nflximg.com/images/2891/Fracture300.jpg\" }\n\t\t\t\t\t],\n\t\t\t\t\t\"url\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\t\"rating\": 5.0,\n\t\t\t\t\t\"bookmark\": [{ id:432534, time:65876586 }]\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t];\n\n\n\t// Use one or more concatMap, map, and reduce calls to create an array with the following items (order doesn't matter)\n\t// [\n\t//\t {\"id\": 675465,\"title\": \"Fracture\",\"boxart\":\"http://cdn-0.nflximg.com/images/2891/Fracture120.jpg\" },\n\t//\t {\"id\": 65432445,\"title\": \"The Chamber\",\"boxart\":\"http://cdn-0.nflximg.com/images/2891/TheChamber130.jpg\" },\n\t//\t {\"id\": 654356453,\"title\": \"Bad Boys\",\"boxart\":\"http://cdn-0.nflximg.com/images/2891/BadBoys140.jpg\" },\n\t//\t {\"id\": 70111470,\"title\": \"Die Hard\",\"boxart\":\"http://cdn-0.nflximg.com/images/2891/DieHard150.jpg\" }\n\t// ];\n\n\treturn movieLists.\n\t\tconcatMap(function(movieList) {\n\t\t\treturn movieList.videos;\n\t\t})\n .concatMap(function(video) {\n return video.boxarts\n .reduce(function(acc, curr) {\n var sizeAcc = acc.width * acc.height;\n var sizeCurr = curr.width * acc.height;\n\n if(sizeAcc > sizeCurr) {\n return curr;\n }\n return acc;\n })\n .map(function(img) {\n return {id: video.id, title: video.title, boxart: img.url};\n });\n })\n\n}\n\t\t","function() {\n\tvar videos = [\n\t\t\t{\n\t\t\t\t\"id\": 70111470,\n\t\t\t\t\"title\": \"Die Hard\",\n\t\t\t\t\"boxart\": \"http://cdn-0.nflximg.com/images/2891/DieHard.jpg\",\n\t\t\t\t\"uri\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\"rating\": 4.0,\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"id\": 654356453,\n\t\t\t\t\"title\": \"Bad Boys\",\n\t\t\t\t\"boxart\": \"http://cdn-0.nflximg.com/images/2891/BadBoys.jpg\",\n\t\t\t\t\"uri\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\"rating\": 5.0,\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"id\": 65432445,\n\t\t\t\t\"title\": \"The Chamber\",\n\t\t\t\t\"boxart\": \"http://cdn-0.nflximg.com/images/2891/TheChamber.jpg\",\n\t\t\t\t\"uri\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\"rating\": 4.0,\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"id\": 675465,\n\t\t\t\t\"title\": \"Fracture\",\n\t\t\t\t\"boxart\": \"http://cdn-0.nflximg.com/images/2891/Fracture.jpg\",\n\t\t\t\t\"uri\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\"rating\": 5.0,\n\t\t\t}\n\t\t],\n\t\tbookmarks = [\n\t\t\t{id: 470, time: 23432},\n\t\t\t{id: 453, time: 234324},\n\t\t\t{id: 445, time: 987834}\n\t\t],\n\tcounter,\n\tvideoIdAndBookmarkIdPairs = [];\n\n\tfor(counter = 0; counter < Math.min(videos.length, bookmarks.length); counter++) {\n var videoId = videos[counter].id;\n var bookmarkId = bookmarks[counter].id;\n videoIdAndBookmarkIdPairs.push({videoId: videoId, bookmarkId: bookmarkId});\n\t\t// Insert code here to create a {videoId, bookmarkId} pair and add it to the videoIdAndBookmarkIdPairs array.\n\t}\n\n\treturn videoIdAndBookmarkIdPairs;\n}\n\t\t","// JSON.stringify(Array.zip([1,2,3],[4,5,6], function(left, right) { return left + right })) === '[5,7,9]'\n\nArray.zip = function(left, right, combinerFunction) {\n\tvar counter,\n\t\tresults = [];\n\n\tfor(counter = 0; counter < Math.min(left.length, right.length); counter++) {\n\t\t// Add code here to apply the combinerFunction to the left and right-hand items in the respective arrays\n\t\tresults.push(combinerFunction(left[counter], right[counter]));\n }\n\n\treturn results;\n};\n\t\t","function() {\n\tvar videos = [\n\t\t\t{\n\t\t\t\t\"id\": 70111470,\n\t\t\t\t\"title\": \"Die Hard\",\n\t\t\t\t\"boxart\": \"http://cdn-0.nflximg.com/images/2891/DieHard.jpg\",\n\t\t\t\t\"uri\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\"rating\": 4.0,\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"id\": 654356453,\n\t\t\t\t\"title\": \"Bad Boys\",\n\t\t\t\t\"boxart\": \"http://cdn-0.nflximg.com/images/2891/BadBoys.jpg\",\n\t\t\t\t\"uri\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\"rating\": 5.0,\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"id\": 65432445,\n\t\t\t\t\"title\": \"The Chamber\",\n\t\t\t\t\"boxart\": \"http://cdn-0.nflximg.com/images/2891/TheChamber.jpg\",\n\t\t\t\t\"uri\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\"rating\": 4.0,\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"id\": 675465,\n\t\t\t\t\"title\": \"Fracture\",\n\t\t\t\t\"boxart\": \"http://cdn-0.nflximg.com/images/2891/Fracture.jpg\",\n\t\t\t\t\"uri\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\"rating\": 5.0,\n\t\t\t}\n\t\t],\n\t\tbookmarks = [\n\t\t\t{id: 470, time: 23432},\n\t\t\t{id: 453, time: 234324},\n\t\t\t{id: 445, time: 987834}\n\t\t];\n\n\treturn Array.\n zip(videos, bookmarks, function(left, right) {\n return {videoId: left.id, bookmarkId: right.id}\n });//... finish this expression\n}\n\t\t","function() {\n\tvar movieLists = [\n\t\t\t{\n\t\t\t\tname: \"New Releases\",\n\t\t\t\tvideos: [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"id\": 70111470,\n\t\t\t\t\t\t\"title\": \"Die Hard\",\n\t\t\t\t\t\t\"boxarts\": [\n\t\t\t\t\t\t\t{ width: 150, height:200, url:\"http://cdn-0.nflximg.com/images/2891/DieHard150.jpg\" },\n\t\t\t\t\t\t\t{ width: 200, height:200, url:\"http://cdn-0.nflximg.com/images/2891/DieHard200.jpg\" }\n\t\t\t\t\t\t],\n\t\t\t\t\t\t\"url\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\t\t\"rating\": 4.0,\n\t\t\t\t\t\t\"interestingMoments\": [\n\t\t\t\t\t\t\t{ type: \"End\", time:213432 },\n\t\t\t\t\t\t\t{ type: \"Start\", time: 64534 },\n\t\t\t\t\t\t\t{ type: \"Middle\", time: 323133}\n\t\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"id\": 654356453,\n\t\t\t\t\t\t\"title\": \"Bad Boys\",\n\t\t\t\t\t\t\"boxarts\": [\n\t\t\t\t\t\t\t{ width: 200, height:200, url:\"http://cdn-0.nflximg.com/images/2891/BadBoys200.jpg\" },\n\t\t\t\t\t\t\t{ width: 140, height:200, url:\"http://cdn-0.nflximg.com/images/2891/BadBoys140.jpg\" }\n\n\t\t\t\t\t\t],\n\t\t\t\t\t\t\"url\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\t\t\"rating\": 5.0,\n\t\t\t\t\t\t\"interestingMoments\": [\n\t\t\t\t\t\t\t{ type: \"End\", time:54654754 },\n\t\t\t\t\t\t\t{ type: \"Start\", time: 43524243 },\n\t\t\t\t\t\t\t{ type: \"Middle\", time: 6575665}\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: \"Instant Queue\",\n\t\t\t\tvideos: [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"id\": 65432445,\n\t\t\t\t\t\t\"title\": \"The Chamber\",\n\t\t\t\t\t\t\"boxarts\": [\n\t\t\t\t\t\t\t{ width: 130, height:200, url:\"http://cdn-0.nflximg.com/images/2891/TheChamber130.jpg\" },\n\t\t\t\t\t\t\t{ width: 200, height:200, url:\"http://cdn-0.nflximg.com/images/2891/TheChamber200.jpg\" }\n\t\t\t\t\t\t],\n\t\t\t\t\t\t\"url\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\t\t\"rating\": 4.0,\n\t\t\t\t\t\t\"interestingMoments\": [\n\t\t\t\t\t\t\t{ type: \"End\", time:132423 },\n\t\t\t\t\t\t\t{ type: \"Start\", time: 54637425 },\n\t\t\t\t\t\t\t{ type: \"Middle\", time: 3452343}\n\t\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"id\": 675465,\n\t\t\t\t\t\t\"title\": \"Fracture\",\n\t\t\t\t\t\t\"boxarts\": [\n\t\t\t\t\t\t\t{ width: 200, height:200, url:\"http://cdn-0.nflximg.com/images/2891/Fracture200.jpg\" },\n\t\t\t\t\t\t\t{ width: 120, height:200, url:\"http://cdn-0.nflximg.com/images/2891/Fracture120.jpg\" },\n\t\t\t\t\t\t\t{ width: 300, height:200, url:\"http://cdn-0.nflximg.com/images/2891/Fracture300.jpg\" }\n\t\t\t\t\t\t],\n\t\t\t\t\t\t\"url\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\t\t\"rating\": 5.0,\n\t\t\t\t\t\t\"interestingMoments\": [\n\t\t\t\t\t\t\t{ type: \"End\", time:45632456 },\n\t\t\t\t\t\t\t{ type: \"Start\", time: 234534 },\n\t\t\t\t\t\t\t{ type: \"Middle\", time: 3453434}\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t];\n\n\t//------------ COMPLETE THIS EXPRESSION --------------\n\treturn movieLists.\n\t\tconcatMap(function(movieList) {\n\t\t\treturn movieList.videos;\n\t\t}).\n concatMap(function(video) {\n return video.boxarts\n .reduce(function(acc, curr) {\n var sizeAcc = acc.width * acc.height;\n var sizeCurr = curr.width * acc.height;\n\n if(sizeAcc > sizeCurr) {\n return curr;\n }\n return acc;\n })\n .concatMap(function(boxart) {\n return video.interestingMoments\n .filter(function(moment) {\n return moment.type === 'Middle'\n })\n .map(function(moment) {\n return {id: video.id, title: video.title, time: moment.time, url: boxart.url};\n });\n });\n });\n\n}\n\t\t"]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment