IF Statement Worksheet

Question 1

Why is an IF statement known as a control structure?

Because it's controlling which code get exuecuted!

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 statements are also controlled!

Question 3

What is a boolean expression?

Something that evalutes true or false

Question 4

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

a operator that compares two values to see if they're equal to each other. assignment operator is giving a variable a new value.

Question 5

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

so it's easier to read and see what code is included in the IF statement!

Question 6

What is a code block in JavaScript?

a code block is a section of code to be exuecuted.

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.