JavaScript If Flashcards
1
Q
Give 6 examples of comparison operators.
A
2
Q
What data type do comparison expressions evaluate to?
A
Comparison operators all return a Boolean (logical) value of true or false
3
Q
What is the purpose of an if statement?
A
guides a program to make decisions based on specified criteria
4
Q
Is else required in order to use an if statement?
A
else statement is not mandatory
5
Q
Describe the syntax (structure) of an if statement.
A
function of value
then if (condition) {
return value{
else if or else {
return value}
6
Q
What are the three logical operators?
A
|| (or) &&(and) !(not)
7
Q
How do you compare two different expressions in the same condition?
A
&& or || symbol