dist/underscore-contrib.js
function(array, n, pad) {
      var p = function(array) {
        if (array == null) return [];

        var part = _.take(array, n);

        if (n === _.size(part)) {
          return _.cons(part, p(_.drop(array, n)));
        }
        else {
          return pad ? [_.take(_.cat(part, pad), n)] : [];
        }
      };

      return p(array);
    }
function(array, n, pad) {
      var p = function(array) {
        if (array == null) return [];

        var part = _.take(array, n);

        if (n === _.size(part)) {
          return _.cons(part, p(_.drop(array, n)));
        }
        else {
          return pad ? [_.take(_.cat(part, pad), n)] : [];
        }
      };

      return p(array);
    }
function ( array , n , pad ) { var p = function ( array ) { if ( array == null ) return [ ] ; var part = _ . take ( array , n ) ; if ( n === _ . size ( part ) ) { return _ . cons ( part , p ( _ . drop ( array , n ) ) ) ; } else { return pad ? [ _ . take ( _ . cat ( part , pad ) , n ) ] : [ ] ; } } ; return p ( array ) ; }
Takes an array and chunks it some number of times into sub-arrays of size n.  Allows and optional padding array as the third argument to fill in the tail chunk when n is not sufficient to build chunks of the same size.
Takes an array and chunks it some number of times into sub - arrays of size n . Allows and optional padding array as the third argument to fill in the tail chunk when n is not sufficient to build chunks of the same size .