A method that can be used to split an array of numbers into smaller N number of arrays.

Usage no npm install needed!

<script type="module">
  import arrayGrouperTwig from '';


Array Grouper

Array Grouper splits a given array of numbers into N smaller arrays where the length of the array and N are both positive integers.


npm i array-grouper-twig


In order to use this array grouper, simply import the groupArrayElements method and call it as shown below.

import { groupArrayElements } from "array-grouper-twig";

var result = groupArrayElements([1, 2, 3, 4, 5], 3);
//result = [ [ 1, 2], [ 3, 4 ], [ 5 ] ]