JavaScript is an interpreted language, it does not compile the code before-hand, it interprets it at the time of execution. Yet JavaScript supports Hoisting, How can it move all the declarations at the top without even compiling the whole program even once. How does this Hoisting and execution actually works??
Asked
Active
Viewed 19 times
0
-
1It goes through two phases- declaration and execution. During the declaration phase, hoisting happens. – ABGR Jun 25 '20 at 14:33
-
https://stackoverflow.com/questions/45620041/how-does-hoisting-work-if-javascript-is-an-interpreted-language, This might help you – Sudhanshu Kumar Jun 25 '20 at 14:35