Comparisons Flashcards

1
Q

Alert true, when x is greater than y.

x = 10;
y = 5;
A

alert(x > y);

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

alert true, when x is equal to y.

x = 10;
y = 10;
A

alert(x == y);

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

alert true, when x is NOT equal to y.

x = 10;
y = 5;
A

alert(x != y);

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

create a var named ageCategory. If age given is less than 18 assign “Minor” otherwise assign “Adult”.

var age = n;

A

var ageCategory = (age < 18) ? “Minor” : “Adult”;

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