ES6 introduced the let and const keyword to declare variables. One of the features of them is it creates a block scope. This was introduced in the year 2015.

Subscribe: https://www.youtube.com/channel/UClN7421hR4zgRTOUtbJTBJg

#es6 #javascript

How to Implement Block Scope with Var Keyword?
8.55 GEEK