javascript-if Flashcards
1
Q
Give 6 examples of comparison operators.
A
<=, >=, ===, < , >
2
Q
What data type do comparison expressions evaluate to?
A
boolean
3
Q
What is the purpose of an if statement?
A
a conditional statement to check whether or not to do certain actions
4
Q
Is else required in order to use an if statement?
A
it is not required
5
Q
Describe the syntax (structure) of an if statement.
A
there is a if keyword followed by a condition in parentheses ( ) and an opening curly brace for the code and closing curly brace
6
Q
What are the three logical operators?
A
&& (and), | | (or), ! (not)
7
Q
How do you compare two different expressions in the same condition?
A
using the logical operators