What's the difference between:
switch (expression) {
case:
somethings;
break;
}
and
switch (expression) {
case: {
somethings;
break;
}
}
At first I thought that I could return an object literal like so, but it turns out it's a syntax error. What's the difference actually?
Example from another question: How to pass switch statement as function argument in Javascript ES6?