group-array-elements
v1.0.4
Published
groups array elements
Downloads
8
Readme
Group Array Elements
What
A function which splits an array 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.
Why
This is for a technical test. Pushing it to Github and NPM was not a requirement.
Getting started
npm i group-array-elements
How to use
import { groupArrayElements } from 'group-array-elements'
groupArrayElements([1,2,3,4,5], 3)
// returns [[1,2], [3,4], [5]]
Contributing
git clone [email protected]:Thebigbignooby/group-array-elements.git
CD into the project.
npm i
and you're ready to go, try running some tests with:
npm run test