入参为不定数量的数组的数组
const data = [
['aa','bb','cc'],
['11','22'],
['AA','BB','CC','DD'],
... //个数不定
]
返回数据如下
["aa11AA", "aa11BB", "aa11CC", "aa11DD", "aa22AA", ..., "cc22DD"]
function cp(arr) {
return arr.reduce(function (a,b) {
let newArr=[]
a.map(v0 => {
b.map(v1 => {
newArr.push('' + v0 + v1);
})
})
return newArr
})
}