Comparison operators Flashcards

1
Q

===, !==, >, and <= are ________ operators.

A

comparison

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

What is the comparison operator for is not equal to?

A

!==

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

What is the comparison operator for is greater than?

A

>

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

What is the comparison operator for is less than or equal to?

A

<=

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

Code the first line of an if statement that tests whether num1 is greater than num2.

A

if (num1 > num2) {

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

Code the first line of an if statement that tests whether num1 is greater than or equal to num2.

A

if (num1 >= num2) {

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

Code the first line of an if statement that tests whether one variable is unequal to another.

A

if (firstName !== nickname) {

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

Code the first line of an if statement that tests whether a variable has a different value from a particular string.

A

if (gender !== “female”) {

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

Code the first line of an if statement that tests whether a variable is less than a particular number.

A

if (num < 1) {

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

Code the first line of an if statement that tests whether the value represented by a variable is greater than or equal to the value represented by another variable.

A

if (num1 >= num2) {

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

Code the first line of an if statement that tests whether a string is unequal to the value represented by a particular variable.

A

if (“Mexico” !== countryOfOrigin) {

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