TGViewer
JavaScript test JavaScript test @js_test · 9.75K subscribers
Post #6468 292
❗️Что будет на выходе:

async function fetchData() {
console.log('1');
return Promise.resolve('data');
}

async function processData() {
console.log('2');
const result = await fetchData();
console.log('3');
return result;
}

console.log('4');
processData().then(() => console.log('5'));
console.log('6');

Ответ: 4 2 1 6 3 5


JavaScript test | #JavaScript & Max
More from @js_test
  1. Sep 25, 2026❓Что будет на выходе? 'use strict'; function strictModeExample() { undeclaredVariable = 10…
  2. Sep 25, 2026❓Что будет на выходе? function mystery(x) { return (function(y) { return x + y; })(x * 2);…
  3. Sep 24, 2026❗️Что будет на выходе: const str = " Hello, World! "; const result = str .trim() .split(",…
  4. Sep 24, 2026❗️Что будет на выходе: function highlight(strings, ...values) { return strings.reduce((res…
  5. Sep 24, 2026❗️Что будет на выходе: function processData({ a = 10, b = 20 } = { a: 30 }) { console.log(…
  6. Sep 23, 2026❗️Что будет на выходе? const team = { members: ['Alice', 'Bob', 'Charlie'], [Symbol.iterat…
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 →