Note: Before you read this article, i suggest you to read: How Closures Work in Javascript. Reading that article will give you the background knowledge you need to understand this article. "Closures in Loop" problem is a familiar problem among javasc...

Markdown supported · ⌘↵ to post
Samandar Boymurodov
React Dev
A Great Explanation Yousaf Khan.
I read your answer to my question on Linkedin where you shared a link to this article. I found this article very useful.
I've understood that var has a function scope which is available all over the function whereas let has a block scope created unieqely for each iteration.