webapi/src/components/string/funcs.js
function (arr, groupSize) {
		var groups = [];
		groupSize = groupSize || 100;
		arr.forEach(function (n, i) {
			var index = Math.trunc(i / groupSize);
			if (groups.length === index) {
				groups.push([]);
			}
			groups[index].push(n);
		});
		return groups;
	}
function (arr, groupSize) {
		var groups = [];
		groupSize = groupSize || 100;
		arr.forEach(function (n, i) {
			var index = Math.trunc(i / groupSize);
			if (groups.length === index) {
				groups.push([]);
			}
			groups[index].push(n);
		});
		return groups;
	}
function ( arr , groupSize ) { var groups = [ ] ; groupSize = groupSize || 100 ; arr . forEach ( function ( n , i ) { var index = Math . trunc ( i / groupSize ) ; if ( groups . length === index ) { groups . push ( [ ] ) ; } groups [ index ] . push ( n ) ; } ) ; return groups ; }
Divide array into an array of arrays of size groupSize
@param {Array} arr
@param {integer} groupSize
Divide array into an array of arrays of size groupSize