import { groupBy } from './groupBy' ; param arr param num returns export function segmentation < T > ( arr , num ) { return Array . from ( groupBy ( arr , ( item , i ) => Math . floor ( i / num ) ) . values ( ) ) ; }