Hoisting Can Be Dangerous
Hoisting is often convenient in JavaScript. It allows us to call functions before they’re defined:
If you define a function inside of a conditional, you run the risk of having a function being overwritten via hoisting:
Edit this Post