TGViewer
JavaScript JavaScript @javascript · 31.1K subscribers
Post #3525 280
CHALLENGE

const order = [];
order.push('start');
setTimeout(() => { order.push('timeout'); console.log(order.join(',')); }, 0);
Promise.resolve().then(() => order.push('promise1'));
async function foo() {
order.push('foo start');
await null;
order.push('foo end');
}
foo();
Promise.resolve().then(() => order.push('promise2'));
order.push('end');
  • ❤ 1
More from @javascript
  1. Sep 29, 2026Post #3526
  2. Sep 28, 2026Post #3524
  3. Sep 28, 2026CHALLENGE let order = []; function a() { try { return 'try'; } finally { order.push('a-fin…
  4. Sep 27, 2026Post #3522
  5. Sep 27, 2026CHALLENGE class Base { value = 10; getValue = () => this.value; constructor() { this.value…
  6. Sep 26, 2026Post #3520
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 →