Javascript-If Flashcards

1
Q

Give 6 examples of comparison operators.

A
  1. ===
  2. !==
  3. >
  4. <
  5. > =
  6. <=
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
  1. boolean data type (true or false)
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
  1. Get you different results for different data.

decisions.

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
  1. No
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
  1. if (condition) { 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
  1. && (and)
  2. ! (not)
  3. || (or)
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

using logical operator.

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