Switch statement / statements&expressions / Ternary Operator Flashcards

1
Q

Explain the switch statement

A

The switch statement is used when comparing one value to multiple options.

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

What is an expression in JS?

A

An expression produces a value.

Example: 3 + 4, 1991

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

What is a statement in JS?

A

These do not Produce values. They are statements that translate actions.

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

The code sample below is a?

age > = 18 ? console.log(‘Old enough to drive’) : console.log(‘Sorry, your’e too young’);

A

A Conditional (Ternary) operator.

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