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
Nomadev -
Norbs' Notes -
Ashish prajapati -
Harish Kumar -
Top comments (0)