ES6 Flashcards

1
Q

What is a code block? What are some examples of a code block?

A

A code block is a where we can write code, some examples are a conditional code block, and a loop code block

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does block scope mean?

A

Block scope describes the accessibility of variables inside of a code block.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the scope of a variable declared with const or let?

A

The code block in which it is declared.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Why is it possible to .push() a new value into a const variable that points to an Array?

A

because an array is mutable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How should you decide on which type of declaration to use?

A

If a variable does not change, use const, otherwise use let

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the syntax for writing a template literal?

A

backticks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is “string interpolation”?

A

the idea that a template literal can be mutated using JavaScript expressoins

How well did you know this?
1
Not at all
2
3
4
5
Perfectly