TGViewer
JavaScript JavaScript @javascript · 31K subscribers
Post #1702 6.38K
CHALLENGE ❓


let funcs = [];

for (var i = 0; i < 3; i++) {
funcs.push(() => i);
}

console.log(funcs[0]());
console.log(funcs[1]());
console.log(funcs[2]());
  • 🤔 6
  • ❤ 5
  • 👍 5
  • 🔥 1
More from @javascript
  1. Oct 14, 2026💻 Deno is Joining Cloudflare (But…) Maybe David Bushell saw the writing on the wall, as t…
  2. Oct 14, 2026Post #3558
  3. Oct 14, 2026CHALLENGE const obj = { value: 42, getValue: function() { return this.value; } }; const un…
  4. Oct 13, 2026Post #3556
  5. Oct 13, 2026CHALLENGE function* inner() { const x = yield 1; yield x + 1; return 100; } function* oute…
  6. Oct 12, 2026Post #3554
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 →