es-6-const-let Flashcards
What is a code block? What are some examples of a code block?
any line of code within { } is a code block.
What does block scope mean?
It means it is only visible inside the code block
What is the scope of a variable declared with const or let?
block scope or local scope
What is the difference between let and const?
Let is mutable and const is not (cant reassign)
Why is it possible to .push() a new value into a const variable that points to an Array?
Const allows you can change the values of the property.
we can change data within inside the memory space. we only reserve that memory space (not changeble). like Home address but can change furniture.
How should you decide on which type of declaration to use?
If you know the value is going to change use let if not stick with const