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); }

相关推荐

点赞 评论 收藏
分享
飞花断音:这个头像有点搞笑
点赞 评论 收藏
分享
牛客网
牛客企业服务