## 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 chunked evenly 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']]```

### 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 chunk using the Map ONLY
*/
static chunkMap(array, chunkSize){

}

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

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

### Summiting.

Then download the array of 10000 elements and generate chunks of size 13 Remember use a webrequest to get the data from the file. You don't have to save the file to the file system. Print out the following, if any of elements do not exist print n/a.
• First element of the chunk at index 43
• The second element of chunk at index 127
• The last element of the chuck at index 742
Remember that javascript zero indexing Submit your solution by answer the quiz on the course site.