top | item 46518478

(no title)

re | 1 month ago

Here's a console command you can run to increase the snake length immediately, and thus the difficulty:

   (() => { let count = 50; const delay = 100; const interval = setInterval(() => { addSnakeNode(); if (--count <= 0) clearInterval(interval); }, delay);})()

discuss

order

londons_explore|1 month ago

Why wrap in a lambda?

re|1 month ago

Because I learned JS before ECMAScript 6 was widely supported by browsers and haven't written a ton of it targeting modern browsers. You're right that it's unnecessary.

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.