CONDITIONALS Flashcards

1
Q

What is an if statement ?

A

Anifstatement checks a condition and will execute a task if that condition evaluates totrue

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

What is this logical operator && ?

A

Logical operator AND : checks if both provided expressions are truthy

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

What is this logical operator || ?

A

Logical operator OR : checks if either provided expression is truthy

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

What is this !

A

The bang operator,!, switches the truthiness and falsiness of a value.

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

What is switch ?

A

Aswitchstatement can be used to simplify the process of writing multipleelse ifstatements.

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

What is the meaning of thebreakkeyword ?

A

Tells the computer to exit the block and not execute any more code or check any other cases inside the code block.

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

What does the case keyword ?

A

Thecasekeyword checks if the expression matches the specified value that comes after it.

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

What is theternary operator?

A

is shorthand to simplify conciseif…elsestatements.

isNightTime ?console.log(‘Turn on the lights!’) :console.log(‘Turn off the lights!’);

Likeif…elsestatements, ternary operators can be used for conditions which evaluate totrueorfalse.

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