Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
function whoDoesWhat(status, time) {
switch (status) {
case 'worker':
switch(time) {
case 'morning':
alert('get ready for working!');
case 'evening':
alert('work hard!');
case 'night':
alert('sleep well for tomorrow!');
}
case 'student':
switch(time) {
case 'morning':
alert('sleep till noon...');
case 'evening':
alert('have breakfast');
case 'night':
alert('play video games');
}
case 'fish':
switch(time) {
case 'morning':
alert('swim slowly');
case 'evening':
alert('swim quickly');
case 'night':
alert('swim very slowly');
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment