title: best practice with javascript switch statement
body: <p>I'm currently working on a jquery script using the switch statement and I was wondering what was the best solution when several 'cases' share some properties, let's say I have this pattern:</p>
  
  <pre><code>switch (settings.xxx) {
  case 'case1':
      Execute some code
      break;
  case 'case2':
      Execute some code
      break;
  case 'case3':
      Execute some code
      break;
  }
  </code></pre>
  
  <p>For each case, I have quite a lot of code that's partly repeated because some properties are common to the 3 cases. So my question is, can I do the same with :</p>
  
  <pre><code>switch (settings.xxx) {
  
  case 'case1':
  case 'case2':
  case 'case3':
      Execute some code
      break;
  
  }
  
  switch (settings.xxx) {
  
  case 'case1':
  case 'case2':
      Execute some code
      break;
  case 'case2':
  case 'case3':
      Execute some code
      break;
  
  }
  </code></pre>
  
  <p>Or is it a bad practice?</p>