title: how to put a switch in a variable in javascript?
body: <p>I'm making a little mini game and I have to put multiple switches inside of themselves, so I really need to know how to put a switch into a few words so I can make this game. I have tried it so that it's fully written out but it takes FOREVER and it is very confusing as to what is what. please help!</p>
  
  <p><strong>EDIT</strong>: im sorry i made this so confusing... let me say that again in english (: what i need to do is make it so when they either choose one of the cases or if they choose none of them (default) it would reactivate the switch. the way the person would choose is through a prompt. so what i thought i could do was make a switch into a variable then use that variable inside the switch basicly creating an endless thing that if they choose default it asks them again. here is an example i will post it in one minute</p>
  
  <p>here you go!: </p>
  
  <pre><code>    //this is the variable holding the switch
      /*I I I I I*/
      /*V V V V V*/
  
      var switch1 = {
      var choice = prompt("do you choose EXAMPLE or EXAMPLE").toUpperCase()
      switch(choice) {
          case 'EXAMPLE':
              //this will repeat the whole prompt
              switch1
          break;
          default:
              //this will repeat it too
              switch1
          break; }
      }
  </code></pre>
  
  <p>So how would i do this and make java accept this @ajaysinghdav10d?</p>