We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
var arr =[['A','B'],['a','b'],[1,2]]
每日一题会在下午四点在交流群集中讨论,五点小程序中更新答案 欢迎大家在下方发表自己的优质见解 二维码加载失败可点击 小程序二维码
The text was updated successfully, but these errors were encountered:
const arr = [ ['A', 'B'], ['a', 'b'], [1, 2], ]; const totalOrdering = (arr) => { return arr.reduce((acc, curr) => { let nextAcc = []; acc.forEach((item) => { curr.forEach((el) => { nextAcc.push(item + el + ''); }); }); return nextAcc; }); }; console.log(totalOrdering(arr));
Sorry, something went wrong.
function totalOrdering(arr) { let res = arr[0] console.log(res) for (let i = 1; i < arr.length; i++) { const pre = res res = [] pre.forEach(item => { arr[i].forEach(curr => { res.push(item + curr) }) }) } console.log(res) return res } const arry = [['A', 'B'], ['a', 'b'], [1, 2]] totalOrdering(arry)
const arr = [['A', 'B'], ['a', 'b'], [1, 2]] const main = (arr) => { return arr.reduce((pre, cur) => { const res = [] pre.forEach(item => { cur.forEach(i => { res.push(item + i) }) }) return res }) } console.log(main(arr))
No branches or pull requests
扫描下方二维码,收藏关注,及时获取答案以及详细解析,同时可解锁800+道前端面试题。
The text was updated successfully, but these errors were encountered: