lib/activedirectory.js
function chunk(arr, chunkSize) {
      var result = [];
      for (var index = 0, length = arr.length; index < length; index += chunkSize) {
        result.push(arr.slice(index,index + chunkSize));
      }
      return(result);
    }
function chunk(arr, chunkSize) {
      var result = [];
      for (var index = 0, length = arr.length; index < length; index += chunkSize) {
        result.push(arr.slice(index,index + chunkSize));
      }
      return(result);
    }
function chunk ( arr , chunkSize ) { var result = [ ] ; for ( var index = 0 , length = arr . length ; index < length ; index += chunkSize ) { result . push ( arr . slice ( index , index + chunkSize ) ) ; } return ( result ) ; }
Breaks the large array into chucks of the specified size.
@param {Array} arr The array to break into chunks
@param {Number} chunkSize The size of each chunk.
@returns {Array} The resulting array containing each chunk
Breaks the large array into chucks of the specified size .