Map Reduce Lab

In this lab, you will get practice with the Map Reduce design paradigm in javascript. The Lodash library is a popular javascript library that implements several useful functions.  One of these functions in called chunk. The chunk function takes two parameters, the array, and the size of the chunk. Instead of using the javascript library your task is to implement the chunk function. You will first implement the chuck function using the map function and then using the reduce function. If the array can't be chunk evening add the remaining items to the last array.  (See the second example)

Implement the chunk function using only the Map function

Implement the chunk function using only the Map function. _.chunk(['a', 'b', 'c', 'd'], 2); // => [['a', 'b'], ['c', 'd']] Upload your code to collab and answer the quiz question.

Implement the chunk function using only the Reduce function

Use the template below to implement the chunk function using only the Reduce Function. _.chunk(['a', 'b', 'c', 'd'], 3); // => [['a', 'b', 'c'], ['d']] Upload your code to collab and answer the quiz question.

Use the template below.


  class Lab4{
    /**
     * Implement chunck using the Map ONLY 
     */
  static chunkMap(array, chunkSize){

    }

    /**
     * Implement chunkc using Reduce ONLY 
     */
     static chunkReduce(array, chunkSize){

     }
}
Upload your code once to assignment session on collab when you are done.

Summitting.

Then download the 10000 array and generate a chunks of 13 Remember use a webrequest to get the data from the file. You don't have to save the file to file system. Print out the following, if any of elements do not exist print n/a. Remember zero indexing