Home >Web Front-end >JS Tutorial >A brief discussion on the improvement of variable and function declarations in JavaScript
Phenomena:
1. In JavaScript, the declaration of variables and functions will be promoted to the top for execution.
2. The promotion of functions is higher than the promotion of variables.
3. If an external variable with the same name is declared using var inside the function, the function will no longer search upwards.
4. Anonymous functions will not be promoted.
5. Functions in different