Since I started writing my #javascript switch cases with braces... I never switched back to unbraced. Feel free to steal :)
2
2
2
Replying to @FremyCompany
Is there a technical advantage in JS, or just style? (In C++, the braces make local variables inside allowed.)

Feb 27, 2017 · 8:55 PM UTC

2
Replying to @davidbaron
if you use let, variables will be local to the block -- discovered this in a C++ codebase btw and decided it was awesome :)
They'll scope any let/const to the case (instead of the switch), but otherwise no effect.