TGViewer
JavaScript test JavaScript test @js_test · 9.7K subscribers
Post #5306 696
❗️Что будет на выходе:
setTimeout(() => console.log('Timeout 1'), 100);

setTimeout(() => {
console.log('Timeout 2');
Promise.resolve().then(() => console.log('Promise in Timeout 2'));
}, 50);

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

setTimeout(() => console.log('Timeout 3'), 150);

console.log('Sync');

Ответ: Sync, Promise 1, Timeout 2, Promise in Timeout 2, Timeout 1, Timeout 3

JavaScript test | #JavaScript
More from @js_test
  1. Oct 10, 2026Муха освоила нейросети и умеет трейдить, играть в гта, делать ставки, а ты пользуешься тол…
  2. Oct 10, 2026❗️Что будет на выходе: function highlight(strings, ...values) { return strings.reduce((res…
  3. Oct 10, 2026❓Что будет на выходе? const a = '10'; const b = 20; const c = '30.5'; const result = Numbe…
  4. Oct 9, 2026❗️Что будет на выходе: function* gen() { yield 1; yield 2; yield 3; } async function async…
  5. Oct 9, 2026❗️Что будет на выходе: const person = { name: 'Alice', greet() { return `Hello, I'm ${this…
  6. Oct 8, 2026❗️Что будет на выходе: function processData({ a = 10, b = 20 } = { a: 30 }) { console.log(…
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 →