logoalt Hacker News

londons_explorelast Tuesday at 11:01 PM2 repliesview on HN

Why wrap in a lambda?


Replies

relast Wednesday at 12:12 AM

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.

tinyhitmanlast Tuesday at 11:13 PM

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.

show 1 reply