async function asyncChain() {
const values = [2, 3, 5, 7, 0];
const total = await values.reduce(async (acc, values) => {
const current = await acc;
return current * values;
}, Promise.resolve(1));
return total;
}
asyncChain().then(result => console.log(result));
Ответ: 0
JavaScript test | #JavaScript