In JavaScript, each function creates its own scope. A new scope is created only when you create a new function. Lexical scope is the ability of a function scope to access variables from the parent/outer scope. Checkout the below diagram for better...
Read moreBy definition, Hoisting is the default behavior of moving all the declarations at the top of the scope before code execution, but this is not exactly what happens. Instead, the variables and function declarations are put into memory during the compil...
Read more