Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

Refactor: change to switch statement #24

Open
helenzhou6 opened this issue Jul 5, 2018 · 0 comments
Open

Refactor: change to switch statement #24

helenzhou6 opened this issue Jul 5, 2018 · 0 comments
Labels

Comments

@helenzhou6
Copy link
Owner

helenzhou6 commented Jul 5, 2018

if (lowestTemp < 5 && highestTemp < 10) {
return "a thick jumper";
} else if (lowestTemp > 20 && highestTemp > 20) {
return "shorts";
} else if (lowestTemp < 20 && highestTemp > 20) {
return "shorts and a jumper";
} else {
return "something not too thin and not too thick";
}

if (precipProbability < 20) {
return `take your chances and don't bring a ${precipType} jacket!`;
} else if (precipProbability > 70) {
return `put on your ${precipType} jacket!`;
} else {
return `carry your ${precipType} jacket (or get your chances - ${100 - precipProbability}% chance of being fine!`;
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant