top | item 46520210 (no title) tinyhitman | 1 month ago Could be to allow use of local variables that do not leak into the scope this code is executed in. That's what I use this pattern for. discuss order hn newest crdrost|1 month ago pro tip: no longer necessary { let count = 50; const interval = setInterval(() => { addSnakeNode(); if (--count <= 0) clearInterval(interval); }, 100) } londons_explore|1 month ago And polluting the global variable namespace hardly matters when using the console.
crdrost|1 month ago pro tip: no longer necessary { let count = 50; const interval = setInterval(() => { addSnakeNode(); if (--count <= 0) clearInterval(interval); }, 100) } londons_explore|1 month ago And polluting the global variable namespace hardly matters when using the console.
londons_explore|1 month ago And polluting the global variable namespace hardly matters when using the console.
crdrost|1 month ago
londons_explore|1 month ago