loading...

re: Opinionated use of JavaScript Switch-Case VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Wat. I am so intrigued const someFlag = true; const name = 'bob'; // or tom switch (name) { case 'bob': return someFlag ? 20 : 10; case ...
 

I agree that yours might be clearer with a smaller example, but when using something with dozens of variables, it's clear and the flexibility is really nice.

Code of Conduct Report abuse