>I'm sorry, but in my decade of JavaScript I never read anything more cryptic than this. What is this supposed to mean?
Switches in JS are just implicit maps.
const caseVal = 'case1';
const result = ({
'case1': (()=> 'case1Val'),
'case2': (()=> 'case2Val'),
'case3': (()=> 'case3Val'),
} [caseVal] || (()=> 'default'))()
Has identical performance to a switch case and is far more idiomatic.