Codington
0 of 10 problems solved • 0%
Use in a course

Exercise prompt

Choose with if and else

An else block runs when the if condition is false. Exactly one of the two branches runs.

Example

const isOpen = false; if (isOpen) { console.log("Come in"); } else { console.log("Closed"); }

This displays Closed.

Your task

Use if and else to display Homework ready when hasHomework is true and Finish homework otherwise.