javascript-if Flashcards

1
Q

Give 6 examples of comparison operators.

A

Six examples of comparison operators are: >, <, >=, <=, ===, ==, !=, !==.

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

Comparison expressions evaluate to single values of true or false. Boolean data type.

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 purpose of an if statement is to do something if a condition is met or to do something if a condition is not met.

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

Else is not required when using an if statement.

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

The syntax of an if statement is: if (*condition) { do this code block } else { do this code block }

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

What are the three logical operators?

A

The three logical operators are: &&, ||, and !

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

To compare two different expressions in the same condition a logical operator && or || must be used.

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