JS If Flashcards

1
Q

Give 6 examples of comparison operators.

A

=== strictly equal to, !== strictly not equal to,
> greater than, < less than,
>= greater than or equal to,
<= less than or equal to

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

To check the condition (lets you get different results for different data)

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

A condition

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

What are the three logical operators?

A

&& logical and, || logical or, ! logical not

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

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

A

By using parentheses and logical operator

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

Describe the syntax (structure) of an if statement.

A

If (condition statement) { //code to execute if value is true}

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