javascript-if Flashcards
Give 6 examples of comparison operators.
Six examples of comparison operators are: >, <, >=, <=, ===, ==, !=, !==.
What data type do comparison expressions evaluate to?
Comparison expressions evaluate to single values of true or false. Boolean data type.
What is the purpose of an if statement?
The purpose of an if statement is to do something if a condition is met or to do something if a condition is not met.
Is else required in order to use an if statement?
Else is not required when using an if statement.
Describe the syntax (structure) of an if statement.
The syntax of an if statement is: if (*condition) { do this code block } else { do this code block }
What are the three logical operators?
The three logical operators are: &&, ||, and !
How do you compare two different expressions in the same condition?
To compare two different expressions in the same condition a logical operator && or || must be used.