TGViewer
JavaScript JavaScript @javascript · 31.1K subscribers
Post #2582 4K
CHALLENGE

const promise1 = Promise.resolve('first');
const promise2 = new Promise(resolve => {
resolve('second');
});

const promise3 = Promise.resolve().then(() => 'third');

async function test() {
console.log('start');

const result1 = await promise1;
console.log(result1);

const result2 = await promise2;
console.log(result2);

const result3 = await promise3;
console.log(result3);

console.log('end');
}

test();
  • ❤ 3
More from @javascript
  1. Oct 2, 2026Post #3532
  2. Oct 2, 2026CHALLENGE const arr = [1, 2, 3]; const log = []; const result = arr.map((x, i) => { if (i…
  3. Oct 1, 2026Post #3530
  4. Oct 1, 2026CHALLENGE class Counter { #count = 0; static #instances = 0; constructor() { Counter.#inst…
  5. Sep 30, 2026Post #3528
  6. Sep 30, 2026CHALLENGE const message = 'a😀bc'; const codePoints = [...message]; const combined = { raw…
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 →