map异步回调版
const asyncList = [ async () => { await sleep(200); return 1; }, async () => { await sleep(300); return 2; }, async () => { await sleep(10); return 3; },];const res = await fn(asyncList, (v) => v());console.log(res); // [1, 2, 3] 复制
const asyncList = [ async () => { await sleep(200); return 1; }, async () => { await sleep(300); return 2; }, async () => { await sleep(10); return 3; },];const res = await fn(asyncList, (v) => v());console.log(res); // [1, 2, 3]
map异步回调版