将数组元素划分为等长的块(二维数组)
index.ts
import * as _ from "lodash";
const list = [1, 2, 3, 4, 5];
const arr = _.chunk(list, 2);
console.log(arr); // [[1, 2], [3, 4], [5]]
index.ts
import * as _ from "lodash";
const list = [1, 2, 3, 4, 5];
const arr = _.chunk(list, 2);
console.log(arr); // [[1, 2], [3, 4], [5]]