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

Exercise prompt

Use a Comparison in if

The condition inside if can be a comparison. JavaScript evaluates it before deciding whether to run the block.

Example

const temperature = 22; if (temperature >= 20) { console.log("Warm"); }

The comparison is true, so the message appears.

Your task

Complete the condition so a score of at least 7 displays Passed.