Making Choices π
Real programs make decisions. We use if and else:
If something is true, do this. Else (otherwise), do that.
function weather(rainy) {
if (rainy) {
return "umbrella β";
} else {
return "sunglasses π";
}
}
If rainy is true, it returns the umbrella. Otherwise, it returns the
sunglasses. Read it carefully, then answer below. π