JavaScript Scope

In JavaScript we can define variable by using “var” and “let” keyword. JavaScript scope works slightly different way than other object oriented programming language like java. In the below example please look how the variables are defined:- Here “var” keyword works differently than the “let” keyword. Here “let” will not be executed at the very…