es6-const-let Flashcards
1
Q
What is a code block? What are some examples of a code block?
A
Code block inside curly braces
2
Q
What does block scope mean?
A
means the code declared inside the curly braces, shadows the code outside
3
Q
What is the scope of a variable declared with const or let?
A
block scoped
4
Q
What is the difference between let and const?
A
The const keyword creates block scoped variables who’s value can’t be reassigned
5
Q
Why is it possible to .push() a new value into a const variable that points to an Array?
A
beacause they are immutable which can be modified
6
Q
How should you decide on which type of declaration to use?
A
const when you don’t want the variable to be reassigned