❓Что будет на выходе?
async function asyncChain() {
const values = [2, 3, 5, 7, 11];
const total = await values.reduce(async (acc, values) => {
const current = await acc;
return current * value;
}, Promise.resolve(1));
return total;
}
asyncChain().then(result => console.log(result));Ответ: 2310
JavaScript test | #JavaScript