Block scope can be used in switch statements. It's sort of a nice syntax that allows you to defined same-named variables without getting 'already defined' errors.
The example is not so great because data
could be rewritten to be let data;
at the top of the function, rather than in each case block.
Blocking scoping is pretty useful.