Title:
JavaScript IF Statements
Updated:
October 26, 2023
Task/Activity:
- Questions
- Coding Problems
- Why is an IF statement known as a control structure?
Because it allows the developer to control what code is executed.
- There are other control structures in JavaScript that we'll be learning about soon. Use your google skills to look up the other control structures in JavaScript and list them below.
There are other control structures like if-else, switch, while, do-while, and for.
- What is a boolean expression?
A boolean expression is essentially an equation that declares whether a statement is true or false.
- What is the 'equality operator', and what is it used for? How is it different from the assignment operator?
The equality operator is a way to measure whether one value is the same as the other, rather than a declaration of what one value is going to be.
- Why is it important to properly indent your code when writing IF statements?
Because code gets very confusing very quickly when you don't format your information properly.
- What is a code block in JavaScript?
A code block is the information within a control structure that is executed when the control structure allows it.