Skip to content

Instantly share code, notes, and snippets.

@elzodxon
Created November 26, 2020 18:32
Show Gist options
  • Save elzodxon/e13862553346b626cea9e3a77a0d07c4 to your computer and use it in GitHub Desktop.
Save elzodxon/e13862553346b626cea9e3a77a0d07c4 to your computer and use it in GitHub Desktop.
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