Function Statement
- hoisted to the top of the full lexical scope
- can break conflicting scripts
- it’s difficult to debug
- named function is shown in the stack trace
- easier to debug when error occurs in the function
1 | /* |
Const Declaration
- edge-case hoisting
- declare a variable
- gives it a block scope
- stops the full hoisting
- cannot be re-declared
- throws exception if re-declared
- easier to debug
- won’t be caught until called
1 | /* |