The
switchstatement evaluates an expression, matching the expression's value to acaseclause, and executes statements associated with thatcase, as well as statements incasesthat follow the matchingcase.(c) MDN
🐊Putout plugin adds ability to find and remove duplecate case.
npm i @putout/plugin-remove-duplicate-case
{
"rules": {
"remove-duplicate-case": "on"
}
}switch(x) {
case 5:
console.log('hello');
break;
case 5:
console.log('zz');
break;
}switch(x) {
case 5:
console.log('hello');
break;
}MIT