es6 - const - let Flashcards
1
Q
What is a code block? What are some examples of a code block?
A
the code between curly braces - if statements function blocks
2
Q
What does block scope mean?
A
that the variable exists inside of the curly braces it was declared in.
3
Q
What is the scope of a variable declared with const or let?
A
block scope
4
Q
What is the difference between let and const?
A
you can re-assign a value to let
5
Q
Why is it possible to .push() a new value into a const variable that points to an Array?
A
because you can adjust the values of a property of what was assigned to a const but not what was assigned itself
6
Q
How should you decide on which type of declaration to use?
A
use const unless you cant and then use let