DEV Community

Discussion on: Closures in JavaScript

Collapse
 
bhagatparwinder profile image
Parwinder 👨🏻‍💻

Thanks for reading and bringing up the confusion. This happened due to my copy paste job from my notes. I have corrected it to var.

As a bonus, I have updated the blog post with an explanation of why let solves this problem as well (similar to closure + IIFE). This should answer the question you have 😅 If you still have any more questions please feel free to follow up.

Collapse
 
endeavor42 profile image
Fitri

Thank you for the quick response! Your explanation answered my question 😄