0 of 10 problems solved • 0%

Exercise prompt

Predict a Branch

Only the branch selected by the condition will run. Read the value first, then predict the message.

Example

const temperature = 22; if (temperature >= 20) { console.log("Warm"); // outputs "Warm" } else { console.log("Cool"); // not run }

Predict the output

A player earns four points. Trace the condition and predict the message they receive.

const points = 4; if (points >= 5) { console.log("Level up"); } else { console.log("Keep practising"); }
What will this code print?