Created
November 26, 2020 18:32
-
-
Save elzodxon/e13862553346b626cea9e3a77a0d07c4 to your computer and use it in GitHub Desktop.
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 followingDay =today => { | |
today = (prompt("Enter day:")).toLowerCase() | |
let nextDay; | |
switch(today){ | |
case 'monday': | |
nextDay = 'Tuesday'; | |
break; | |
case 'tuesday': | |
nextDay = 'Wednesday'; | |
break; | |
case 'wednesday': | |
nextDay = 'Thursday'; | |
break; | |
case 'thursday': | |
nextDay = 'Friday'; | |
break; | |
case 'friday': | |
nextDay = 'Saturday'; | |
break; | |
case 'saturday': | |
nextDay = 'Sunday'; | |
break; | |
case 'sunday': | |
nextDay = 'Monday'; | |
break; | |
default: | |
nextDay = 'Invalid'; | |
break; | |
} | |
console.log(`Next day is ${nextDay}`) | |
} | |
followingDay(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment