title: Switch case match with string
body: <pre><code>function getFieldType(value){
      var type = "";
      switch(value){
          case "TEXT_BOX":
              type=FieldTypeEnum.TEXT_BOX;
              break;
          case "PASSWORD":
              type=FieldTypeEnum.PASSWORD;
              break;
          case "CHECK_BOX":
              type=FieldTypeEnum.CHECK_BOX;
              break;
          case "RADIO_BUTTON":
              type=FieldTypeEnum.RADIO_BUTTON;
              break;
          case "DROP_DOWN":
              type=FieldTypeEnum.DROP_DOWN;
              break;
          case "SEARCH_CARD_BOX":
              type=FieldTypeEnum.SEARCH_CARD_BOX;
              break;        
          case "STATE_DROP_DOWN":
              type=FieldTypeEnum.STATE_DROP_DOWN;
              break;
          case "ID_DROP_DOWN":
              type=FieldTypeEnum.ID_DROP_DOWN;
              break;
          case "GENDER_DROP_DOWN":
              type = FieldTypeEnum.GENDER_DROP_DOWN;
              break;
          default:
              type = "";
      }
  
      return type;
  }
  </code></pre>
  
  <p>I want to combined three drop down box <code>(STATE_DROP_DOWN, ID_DROP_DOWN, GENDER_DROP_DOWN)</code>into one .
  Means I want something like below :</p>
  
  <pre><code>case String.endwith("_DROP_DOWN"):
       type=FieldTypeEnum.ID_DROP_DOWN;
       break;
  </code></pre>
  
  <p>Is it possible in JavaScript? If yes then how?   </p>