Before
let b;
switch (a) {
case '#':
b = 'one';
break;
case '##':
b = 'two';
break;
default:
b = 'unknown';
}
After
let b = ({
'#': 'one',
'##': 'two'
})[a] ?? 'unknown';
For further actions, you may consider blocking this person and/or reporting abuse
Noureddine Belguinan -
codemee -
Nik L. -
Prajesh Gawhale -
Top comments (0)