Skip to content

Instantly share code, notes, and snippets.

@poteto
Last active September 30, 2015 23:07
Show Gist options
  • Save poteto/9b3fed724b8bedd8342b to your computer and use it in GitHub Desktop.
Save poteto/9b3fed724b8bedd8342b to your computer and use it in GitHub Desktop.
const MESSAGES = {
400(foo) {
// stuff
},
404(foo) {
// stuff
},
500(foo) {
// stuff
}
};
function blah(statusCode, foo) {
return MESSAGES[statusCode](foo) || '¯\\_(ツ)_/¯';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment