Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (!['get', 'post'].includes(x)) {
- throw new Error('OhGodWhy')
- }
- if (x !== 'get' && x !== 'post') {
- throw new Error('OhGodWhy')
- }
- const methods = { get: true, post: true }
- if(!methods[x]) throw new Error('OhGodWhy')
Add Comment
Please, Sign In to add comment