Please enable JavaScript to use CodeHS

Chapter 2


2.2 If Statements

If Statements

If/Else Statements

If/Else Statement

Check Your Understanding

  1. Incorrect Correct No Answer was selected Invalid Answer

Exercise: Is It Snowing?


Term Definition
If Statement An if statement lets you ask a question to the program and only run code if the answer is true.