Guest User

Untitled

a guest
Nov 20th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. if (!['get', 'post'].includes(x)) {
  2. throw new Error('OhGodWhy')
  3. }
  4.  
  5. if (x !== 'get' && x !== 'post') {
  6. throw new Error('OhGodWhy')
  7. }
  8.  
  9. const methods = { get: true, post: true }
  10.  
  11. if(!methods[x]) throw new Error('OhGodWhy')
Add Comment
Please, Sign In to add comment