95 Flashcards

(1 cards)

1
Q

Best Practices for variable and function declarations regarding Hoisting

A
  • don’t use var! (use const most of the time and let, if you really need to change the variable later
  • declare your variables at the top of each scope
  • declare all your functions first and use them only after the declaration (> applies to all types of functions; > you could use function declarations before you declare them but just don’t do that, it’s not clean!)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly