It seems like I might be missing something, but I am unsure of how to extract the result from an else-if statement. Take this code snippet that I've been working on for example:
In this scenario, the output would read "It's warm!", and what I want is to write a piece of code that reacts based on this result. However, since the result isn't stored in a variable, I'm not sure how to create a response based on the logged message. For instance, if it logs "It's warm!", I would like to include additional instructions like "Turn on the AC." or "Turn on the heater" depending on the situation. How can I achieve this?
let temperature = 36
if (temperature > 24) {
console.log ("It's warm!");
} else if (temperature < 24) {
console.log ("It's cold!");
} else {
console.log ("It's cool!");