13 Flashcards
(3 cards)
1
Q
const x;
A
> error !
(variables declared with const need an initial value)
2
Q
When to use let, const and var?
A
- use const by default
- use let when you’re really sure that the variable needs to change in the future
- avoid var!
3
Q
job = ‘programmer’
A
you should always declare variables with let or const