IF Statement Worksheet
Question 1
Why is an IF statement known as a control structure?
Because it will take the information and flow it through the structure until it comes back with a true statement.
Question 2
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.
IF/THEN is one that wasn't covered in the video
Question 3
What is a boolean expression?
It's either true or false
Question 4
What is the 'equality operator', and what is it used for? How is it different from the assignment operator?
"==" is the equality operator. It's used to see if something is equal to instead of assigning.
Question 5
Why is it important to properly indent your code when writing IF statements?
Because if it grows into a long ladder it will be easier to see or look for bugs.
Question 6
What is a code block in JavaScript?
Also known as a branch, anything between curly brackets "{}"
Coding Problems
Coding Problems - See the 'script' tag below this h3 tag. You will have to write some JavaScript code in it.
Always test your work! Check the console log to make sure there are no errors.