摘要:
const ids = [1, 2, 3] const resArr = [] // 1 ids.forEach(id => api(id).then(res => resArr.push(res)) // 2 Promise.all(ids.map(id => api(id).then(res = 阅读全文
摘要:
function add(x) { var sum = x; var tmp = function (y) { sum = sum + y; return tmp; }; tmp.toString = function () { return sum; }; return tmp; } consol 阅读全文