TGViewer
JavaScript test JavaScript test @js_test · 9.68K subscribers
Post #4789 918
❗️Что будет на выходе:
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
More from @js_test
  1. Oct 17, 2026❗️Что будет на выходе: function greet(name) { return `Hello, ${name}!`; } function highlig…
  2. Oct 17, 2026❗️Что будет на выходе: const counter = (function () { let count = 0; const history = []; r…
  3. Oct 16, 2026❗️Что будет на выходе: const memoryLeak = () => { const cache = new Map(); const weakCache…
  4. Oct 16, 2026❗️Что будет на выходе: const createMathOps = (base) => { return { add: (x) => base + x, mu…
  5. Oct 16, 2026❗️Что будет на выходе: const person = { name: 'Alice', greet() { return `Hello, I'm ${this…
  6. Oct 15, 2026❗️Что будет на выходе: try { try { // Creating a custom error type class CustomError exten…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →