JS If Flashcards
Give 6 examples of comparison operators.
=== strictly equal to, !== strictly not equal to,
> greater than, < less than,
>= greater than or equal to,
<= less than or equal to
What data type do comparison expressions evaluate to?
Boolean
What is the purpose of an if statement?
To check the condition (lets you get different results for different data)
Is else required in order to use an if statement?
A condition
What are the three logical operators?
&& logical and, || logical or, ! logical not
How do you compare two different expressions in the same condition?
By using parentheses and logical operator
Describe the syntax (structure) of an if statement.
If (condition statement) { //code to execute if value is true}