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
Joseph Abraham -
Hamza Khan -
Romina Mendez -
Tomas Stveracek -
Top comments (0)