Javascript-if Flashcards
1
Q
Give 6 examples of comparison operators.
A
Strictly equal to, not strictly equal to, greater than, less than, greater than or equal to, less than or 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
Evaluates a given expression and makes a decision based on that.
4
Q
Is else required in order to use an if statement?
A
Else is not required.
5
Q
Describe the syntax (structure) of an if statement.
A
If keyword, condition, optional code block and return statement
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 and AND