code: function splitArray(arr, n) {
    var r = [];
  
    if (isFunction(n)) {
      var getChunkLength = n;
      var times = 1;
      var i = 0;
  
      while (i < arr.length) {
        var _n = getChunkLength(times);
  
        var end = i + _n;
        r.push(arr.slice(i, end));
        i = end;
        times++;
      }
    } else {
      var _i = 0;
  
      while (_i < arr.length) {
        var _end = _i + n;
  
        r.push(arr.slice(_i, _end));
        _i = _end;
      }
    }
  
    return r;
  }
docs: n can be getter(number of times) n可以是方法, 参数1是第几次分块