Created
May 10, 2012 19:41
JavaScript switch statement with strings
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
switch(req.method) { | |
case 'POST': | |
break; | |
case 'GET': | |
break; | |
case 'DELETE': | |
break; | |
case 'PUT': | |
break; | |
default: | |
// error | |
break; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment