r/javascript • • May 28 '19

What are some JavaScript things beginners don't know?

333 Upvotes

383 comments sorted by

View all comments

16

u/DerGernTod May 28 '19

IIFEs are a concept not really well known in other programming languages, yet they've been quite common in js, especially when working with closures. however, as of const and let they mostly lost their right to exist :D

3

u/[deleted] May 28 '19

They're great for writing one-off scripts with a lot of async stuff using async/await :)

3

u/senocular May 28 '19

I think requiring the use of async was the only time I've ever used an IIFE in the past couple of years. Was never a fan of the pattern, and with top level await I may never use it again :)