Hoisting might sound a bit confusing but it’s really not, let’s see how.
What is Hoisting ?
Let’s see how hoisting works for variables and function declarations below :
Before the execution starts, all the function declarations are present in the memory object. A property is created in the memory object, which points to the functions.
In the below snippet, as we all know, in this case, the result will be 5. …