This coding challenge to demonstates some small executable code.
The groupArrayElements function should:
- Given an array of length >= 0, and a positive integer N, return the contents of the array divided into N equally sized arrays.
- Where the size of the original array cannot be divided equally by N, the final part should have a length equal to the remainder
Install the required npm packages
npm iThe following npm script will execute unit tests written in Jest
npm testNormally I'd use tools such as babel or TypeScript, webpack etc but didn't consider this a requirement for this coding challenge.
The best way to see the code in action is to run the tests.