Hoisting is not something functions and variables are moving to the top.
Actually, they are not moving technically anywhere.
The thing happens at the time of function declaration the complete function
is sitting in the memory.
For functions, the full function is added to the memory space.
That is the reason we can invoke the functions anywhere in the file but not variables.for variables, we only used once it is declared first.
Hope you guys love these.