I am the entry level of learning JS and following a tutorial I am given this code
function shouldYouGoToTheLake(weather, waterTemperature) {
if (weather == "sunny") {
return true;
} else if (waterTemperature >= 20) {
return true;
} else {
return false;
}
}
shouldYouGoToTheLake("sunny", 0); // true
shouldYouGoToTheLake("sunny", 10); // true
shouldYouGoToTheLake("cloudy", 25); // true
shouldYouGoToTheLake("cloudy", 18); // false
My question is how do you get a return? It is not enough to write shouldYouGoToTheLake(“sunny”, 0); as visual code studio runs the code without a return. Something is missing.
I did not run try to run all 4 returns in one sequence.
I run only 1 sequence
shouldYouGoToTheLake(“sunny”, 0);