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

console.log('1');

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

Promise.resolve().then(() => console.log('3'));

queueMicrotask(() => console.log('4'));

setTimeout(() => console.log('5'), 0);

Promise.resolve().then(() => {
console.log('6');
return Promise.resolve();
}).then(() => console.log('7'));

console.log('8');

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

JavaScript test | #JavaScript
More from @js_test
  1. Oct 5, 2026❗️Что будет на выходе: function trickyScope() { let x = 10; if (true) { let x = 20; consol…
  2. Oct 5, 2026❓Что будет на выходе? 'use strict'; function strictModeExample() { undeclaredVariable = 10…
  3. Oct 3, 2026❗️Что будет на выходе: function multiply(a, b) { if (b === 0) { return 0; } else if (b > 0…
  4. Oct 3, 2026👨‍💻 Фронтенд с AI: что можно делегировать агентам 5 октября, стартует конференция Podlod…
  5. Oct 2, 2026❗️Что будет на выходе? async function test() { console.log('1'); setTimeout(() => { consol…
  6. Oct 2, 2026❗️Что будет на выходе? const target = { a: 1, b: 2 }; const handler = { get(obj, prop) { r…
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 →