var _result = [];
var resultArr = [];
function combination(arr, depth) {
for (let i = 0; i < arr[depth].length; i++) {
this._result[depth] = arr[depth][i];
if (depth !== arr.length - 1) {
this.doExchange(arr, depth + 1);
} else {
this.resultArr.push(this._result.join('+'));
}
}
return this.resultArr;
}
var tempArr = [
["503357000001002","500397000001004"],
["500477000001009","500557000001002","500637000001009"]
];
combination(tempArr,0);
多维数组的排列组合或多个数组之间的排列组合
于 2020-08-28 09:04:01 首次发布