title: javascript switch() or if()
body: <p>which would be better if i do this:</p>
  
  <pre><code>if(message == 'redirect')
  {
      is_valid.accepted = true;
  }
  else if(message == 'invalid id')
  {
      is_valid.accepted = false;
  }
  else
  {
      is_valid.accepted = false;
  }
  </code></pre>
  
  <p>or i do it this way</p>
  
  <pre><code>switch (message)
  {
  case 'invalid id':
  default:
      is_valid.accepted = false;
      break;
  case 'redirect':
      is_valid.accepted = true;
      break;
  }
  </code></pre>