The chicken or the egg came first
The compiler strikes again
- The declaration is executed first in the compilation phase, and the assignment is executed in the execution phase
- Function declarations will be promoted, but function expressions will not be promoted
Function first
- In JavaScript, repeated declarations are ignored.
- Function declaration priority is higher than the priority of variable declaration
summary