DEV Community

Discussion on: What is Hoisting Anyway?

Collapse
 
anshulnegitc profile image
Anshul Negi

why javascript perform hoisting?
As in some cases, we mistakenly define variables or function declarations that are unused throughout the code but due to hoisting it will take all variable and function declarations to memory along with unused variables and function declarations thus slowing the speed of execution.