TGViewer
JavaScript test JavaScript test @js_test · 9.77K subscribers
Post #6546 126
❗️Что будет на выходе?

async function test() {
console.log('1');

setTimeout(() => {
console.log('2');
}, 0);

await Promise.resolve();
console.log('3');

new Promise(resolve => {
console.log('4');
resolve();
}).then(() => {
console.log('5');
});

console.log('6');
}

test();
console.log('7');

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

JavaScript test | #JavaScript & Max
More from @js_test
  1. Sep 20, 2026❗️Что будет на выходе? const user = { profile: { name: 'Alice', settings: { notifications:…
  2. Sep 20, 2026❗️Что будет на выходе? function* range(start, end) { while (start < end) { yield start++;…
  3. Sep 19, 2026❗️Что будет на выходе: const arr = [3, 8, 12]; const even = (elem) => elem % 2 === 0; cons…
  4. Sep 19, 2026❓Что будет на выходе? const compose = (...fns) => fns.reduce((f, g) => (...args) => f(g(..…
  5. Sep 19, 2026❓Что будет на выходе? const obj1 = { a: 1, b: 2 }; const obj2 = { b: 3, c: 4 }; const merg…
  6. Sep 18, 2026❓Что будет на выходе? const curry = (fn) => { const arity = fn.length; return function cur…
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 →