Home > Web Front-end > JS Tutorial > body text

A brief discussion on the improvement of variable and function declarations in JavaScript

高洛峰
Release: 2017-02-15 17:19:03
Original
1612 people have browsed it

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

Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template