TGViewer
JavaScript JavaScript @javascript · 31K subscribers
Post #1515 6.4K
SPONSORED BY Blacksmith 👩‍🚒
Run GitHub Actions 2x faster at half the cost.

CHALLENGE
❓


const obj = {
a: 1,
b() {
return new Promise(resolve => {
setTimeout(() => {
resolve(this.a);
}, 100);
});
}
};

obj.b().then(console.log);

obj.a = 2;
  • 👍 18
  • 🔥 6
  • 🤔 6
  • ❤ 5
More from @javascript
  1. Oct 17, 2026Post #3566
  2. Oct 17, 2026CHALLENGE async function run() { const results = await Promise.allSettled([ Promise.resolv…
  3. Oct 16, 2026Post #3564
  4. Oct 16, 2026CHALLENGE const x = 0; const y = ''; const z = null; const r1 = x ?? y ? 'A' : 'B'; const…
  5. Oct 15, 2026🤟 You Don’t Know Node.js EventLoop (30 min read) You might be wondering if the title of t…
  6. Oct 15, 2026Post #3561
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 →