Often your program needs to behave differently depending on a condition. That's what if and else are for:
const temperature = 22
if (temperature > 30) {
console.log("It's hot!")
} else if (temperature > 15) {
console.log("Nice weather")
} else {
console.log("Put on a jacket")
}
// Output: Nice weather
5 > 3 // true — greater than
5 < 3 // false — less than
5 >= 5 // true — greater than or equal
5 === 5 // true — strictly equal (always use === not ==)
5 !== 3 // true — not equal
Write a function grade(score) that returns a letter grade:
"A""B""C""F"Click "Run" to execute your code.