Last active
December 30, 2015 14:29
-
-
Save chuck0523/971fa2ed33701921f93b 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
var status = { | |
'worker' : 0, | |
'student' : 1, | |
'fish' : 2 | |
}; | |
var time = { | |
'morning' : 0, | |
'evening' : 1, | |
'night' : 2 | |
} | |
var text = [ | |
['get ready for working!', 'work hard!', 'sleep well for tomorrow!'], | |
['sleep till noon...', 'have breakfast', 'play video games'], | |
['swim slowly', 'swim quickly', 'swim very slowly'] | |
]; | |
function whoDoesWhat_short(a, b) { | |
var who = status[a]; | |
var what = time[b]; | |
console.log(text[who][what]); | |
} | |
whoDoesWhat_short('worker', 'evening'); // work hard! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment