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.
2
Q
What is an expression in JS?
A
An expression produces a value.
Example: 3 + 4, 1991
3
Q
What is a statement in JS?
A
These do not Produce values. They are statements that translate actions.
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.