async function add(...rest) { const ns = [...rest]; const ps = []; while(ns.length) { const n1 = ns.pop(); const n2 = ns.pop() || 0; ps.push(addRemote(n1, n2)); } const t = await Promise.all(ps); if(t.length === 1) return t[0]; return add(...t); }

相关推荐

爱睡觉的冰箱哥:你是我今晚见过的最美的牛客女孩
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务