js miscellaneous notes

Note: When using anonymous function expressions, the function call statement must be placed after the function declaration statement! ! ! (Difference from ordinary functions)
[Execution sequence of js code]
When js code is running, it will be divided into two parts. Check the loading and execution phases. Check the loading phase: the syntax error of the code will be detected first, and the declaration of variables and functions will be carried out.

Execution stage: variable assignment, function call, etc., all belong to the execution stage.

 

Functions are variables in JavaScript 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324732516&siteId=291194637