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
Viktor Le -
Manoj Mohan -
Ayoola Damilare -
Trinmar Boado -
Top comments (0)