Only the branch selected by the condition will run. Read the value first, then predict the message.
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");
}