IF Statement Worksheet

Question 1

Why is an IF statement known as a control structure?

Because it allows you to determine where the code goes based of your answer true or false

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.

loops, ternary, and jumping and error handling

Question 3

What is a boolean expression?

Its a code that is used to evaulate a true or false statement

Question 4

What is the 'equality operator', and what is it used for? How is it different from the assignment operator?

It is used to compare 2 values to se if the return is going to come back the same and the assignment opporator is used to set qa value

Question 5

Why is it important to properly indent your code when writing IF statements?

It is cruitial for indentation in your code becuase it becomes almost impossible to find errors when debugging a code and for errors

Question 6

What is a code block in JavaScript?

Its a group of code statements closed by the curly braces

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.