Skip to content

Instantly share code, notes, and snippets.

@Rockncoder
Created May 10, 2012 19:41
Show Gist options
  • Save Rockncoder/2655371 to your computer and use it in GitHub Desktop.
Save Rockncoder/2655371 to your computer and use it in GitHub Desktop.
JavaScript switch statement with strings
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