Created
February 23, 2011 22:07
-
-
Save robotlolita/841303 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
function try_me (str) { | |
switch (str) { | |
case "foo": console.log("buu~"); break | |
case "bar": console.log("baz~"); break | |
default: console.log("bad, bad argument, no cookies for you.") } | |
} | |
try_me("foo") // "buu~" | |
try_me("bar") // "baz~" | |
try_me("nou") // "bad, bad argument, no cookies for you." | |
try_me() // "bad, bad argument, no cookies for you." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment