Es6-const-let Flashcards
1
Q
What is a code block? What are some examples of a code block?
A
anything within { } if-else statements, for loops
2
Q
What does block scope mean?
A
area within code block where the variables only exist in
3
Q
What is the scope of a variable declared with const or let?
A
both are block scope
4
Q
What is the difference between let and const?
A
let can be re assigned
5
Q
Why is it possible to .push() a new value into a const variable that points to an Array?
A
not reassigning the const variable, just changing what it is referring to
6
Q
How should you decide on which type of declaration to use?
A
use const all the time unless you get an error, then use let