Р
Size: a a a
Р
PR
М
async function promisesInSeries(functions) {
return Promise.all(functions).then(result => result)
}
Р
PR
j
PR
j
Р
Р
М
Р
j
async function promisesInSeries (functions) {
if (functions) {
const result = []
const promises = functions.map(func => func())
for (const promise of promises) {
promise.then((data) => result.push(data))
}
await Promise.all(promises)
return result.flat()
}
}
j
j
М
М
Р