Skip to content
All challenges
ProgrammingPredict the outputBeginner2 min

The first matching branch

Skills: Control flow

Task

Read the code and type exactly what it logs.

Your answer

const temperature = 28;

if (temperature > 30) {
  console.log("hot");
} else if (temperature > 20) {
  console.log("warm");
} else {
  console.log("cool");
}