Understanding JavaScript Scope in the for-loop with var and let
26 April, 2022
17
17
2
Contributors
Why did I Create this Video?
The other day, I was doing a code review where a click handler was not passing the correct value to a function. When I dug into it, guess what I found 🙄? It is just a three-letter fix, replacing var with let. That's it. However, underneath it was the misunderstanding of the JavaScript Scope on the developer's part.
That's what triggered me to create this video. I hope you enjoy watching it.
Please SUBSCRIBE to the Channel to get Video Content on JavaScript, React, Git, GitHub, Next.js, Career, and more.
javascript
globalscope
js
loop