Created
April 10, 2019 03:25
-
-
Save mhaidarhanif/c2a9b84cf256efdfbed2f683ea4e3feb to your computer and use it in GitHub Desktop.
Weather Advisor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const adviseMe = weather => { | |
switch (weather) { | |
case 'Rainy': | |
case 'Rain': | |
return 'bawa payung atau gunakan jas hujan' | |
break | |
case 'Stormy': | |
return 'kabarin keluarga yak' | |
break | |
case 'Sunny': | |
return 'santai aja cuy' | |
break | |
case 'Cloudy': | |
return 'ya mayan lah' | |
break | |
case 'Hot': | |
return 'bawa sunscreen' | |
break | |
case 'Cold': | |
return 'pake jaket yang tebel' | |
break | |
case 'Dry': | |
return 'pake pelembab' | |
break | |
case 'Wet': | |
return 'pake sepatu boots' | |
break | |
case 'Windy': | |
return '...' | |
break | |
case 'Hurricanes': | |
return '...' | |
break | |
case 'typhoons': | |
return '...' | |
break | |
case 'Sand-Storms': | |
return '...' | |
break | |
case 'Snow-Storms': | |
return '...' | |
break | |
case 'Tornados': | |
return '...' | |
break | |
case 'Humid': | |
return '...' | |
break | |
case 'Foggy': | |
return '...' | |
break | |
case 'Snow': | |
case 'Snowy': | |
return 'hore ada salju!' | |
break | |
case 'Thundersnow': | |
return '...' | |
break | |
case 'Hail': | |
return '...' | |
break | |
case 'Sleet': | |
return '...' | |
break | |
case 'Drought': | |
return '...' | |
break | |
case 'Wildfire': | |
return '...' | |
break | |
case 'Blizzard': | |
return '...' | |
break | |
case 'Avalanche': | |
return '...' | |
break | |
default: | |
return 'cuaca yang enak untuk aktifitas' | |
break | |
} | |
} | |
const weather = prompt('What is the weather today?') | |
const advise = adviseMe(weather) | |
console.log(weather, '-', advise) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment