Conditions Flashcards

1
Q

alert “Hello World” if x is greater than y.

A

if (x > y) {
alert(“Hello World”);
}

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

alert “Hi” if x is greater than y, otherwise alert “Bye”.

A
if (x > y) {
alert("Hi");
} else {
alert("Bye");
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly