javascript-if Flashcards

1
Q

Give 6 examples of comparison operators.

A

<, <=, >, >=, ==, ===, !=, !==

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

What data type do comparison expressions evaluate to?

A

Boolean

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

What is the purpose of an if statement?

A

The if statement evaluates a condition. If the condition is true, any statements in the subsequent code block are executed.

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

Is else required in order to use an if statement?

A

No, you would just continue to the next line of code

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

Describe the syntax (structure) of an if statement.

A

Keyword if, condition in parentheses, opening curly brace, code block, closing curly brace

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

What are the three logical operators?

A

&& (and), || (or), ! (not)

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

How do you compare two different expressions in the same condition?

A

Use a logical operator

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