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

function task1() {
console.log('A');
setTimeout(() => console.log('B'), 0);
Promise.resolve().then(() => console.log('C'));
Promise.resolve().then(() => setTimeout(() => console.log('D'), 0));
Promise.resolve().then(() => console.log('E'));
setTimeout(() => console.log('F'), 0);
console.log('G');
}

task1();

Ответ: A G C E B F D


JavaScript test | #JavaScript & Max
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 →