Skip to content

Instantly share code, notes, and snippets.

@chuck0523
Last active December 30, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chuck0523/2f786f89069acd1edce1 to your computer and use it in GitHub Desktop.
Save chuck0523/2f786f89069acd1edce1 to your computer and use it in GitHub Desktop.
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