我可以使用lodash如何合并数组中的数组?
例如:
例如:
目前我的代码执行以下操作:Input:
var x = [ [1,2,3,4], [5,6,7], [], [8,9], [] ];
Expected output:
x = [1,2,3,4,5,6,7,8,9];
return promise.map(someObjects, function (object)) {
return anArrayOfElements();
}).then(function (arrayOfArrayElements) {
// I tried to use union but it can apply only on two arrays
_.union(arrayOfArrayElements);
});
_.flatten
吗? - Bergi