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

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
More from @js_test
  1. Oct 16, 2026❗️Что будет на выходе: const memoryLeak = () => { const cache = new Map(); const weakCache…
  2. Oct 16, 2026❗️Что будет на выходе: const createMathOps = (base) => { return { add: (x) => base + x, mu…
  3. Oct 16, 2026❗️Что будет на выходе: const person = { name: 'Alice', greet() { return `Hello, I'm ${this…
  4. Oct 15, 2026❗️Что будет на выходе: try { try { // Creating a custom error type class CustomError exten…
  5. Oct 15, 2026❗️Что будет на выходе: const createMathOps = (base) => { return { add: (x) => base + x, mu…
  6. Oct 15, 2026❗️Что будет на выходе: const team = { name: 'Eagles', players: ['Smith', 'Johnson', 'Willi…
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 →