if Flashcards
(6 cards)
1
Q
Give 6 examples of comparison operators.
A
greater than ( > )
less than ( < )
greater than or equal to ( >= )
less than or equal to ( <= )
equal to ( == )
not equal to ( !== )
strictly equal to ( === )
2
Q
What data type do comparison expressions evaluate to?
A
boolean, true or false
3
Q
What is the purpose of an if statement?
A
to make a decision
4
Q
Is else required in order to use an if statement?
A
no
5
Q
Describe the syntax (structure) of an if statement.
A
if ( the condition to evaluate) {
what you want to execute if the condition is valid
}
6
Q
What are the three logical operators?
A
&& LOGICAL AND
|| LOGICAL OR
! LOGICAL NOT