javascript-if Flashcards
Give 6 examples of comparison operators.
<, <=, >, >=, ==, ===, !=, !==
What data type do comparison expressions evaluate to?
Boolean
What is the purpose of an if statement?
The if statement evaluates a condition. If the condition is true, any statements in the subsequent code block are executed.
Is else required in order to use an if statement?
No, you would just continue to the next line of code
Describe the syntax (structure) of an if statement.
Keyword if, condition in parentheses, opening curly brace, code block, closing curly brace
What are the three logical operators?
&& (and), || (or), ! (not)
How do you compare two different expressions in the same condition?
Use a logical operator