If / Then Lesson 1
Choice Challenge
Students edit a tiny real-code example and run it to see how a condition changes the result.
Make a choice program.
Change the condition, action, or message, then run the code.
Example code
let hasKey = true;
if (hasKey) {
say("The door opens!");
} else {
say("Find the key first.");
}
Program result
- Run your choice to see output.
Change true to false to test the other path.
Choice challenge complete.
You ran a real if statement and saw how true or false changes the result.
Finish If / Then Challenge