JS if statements Flashcards
1
Q
Give 6 examples of comparison operators.
A
< less than > greater than = equals <= less than equal to >= greater than equal to === strictly equal to !== strictly not equal to
2
Q
What data type do comparison expressions evaluate to?
A
boolean
3
Q
What is the purpose of an if statement?
A
to determine what path to take, what decision to make
4
Q
Is else required in order to use an if statement?
A
no, not necessary
5
Q
Describe the syntax (structure) of an if statement.
A
if ( condition) {
return }
6
Q
How do you compare two different expressions in the same condition?
A
with logical operators
7
Q
How do you compare two different expressions in the same condition?
A
with logical operators (&&) or (||)