title: Javascript - Reduce the number of IF statements
body: <p>is there a javascript select case type function to set a variable how the following code would perform? i see a CASE function but it doesn't really seem that much more efficient from a line number footprint</p>
  
  <pre><code>  if (i == 1){
      ResToUse = Res1
    }
  
    if (i == 2){
      ResToUse = Res2
    }
  
    if (i == 3){
      ResToUse = Res3
    }
  
    if (i == 4){
      ResToUse = Res4
    }
  
    if (i == 5){
      ResToUse = Res5
    }
  
    if (i == 6){
      ResToUse = Res6
    }
  
    if (i == 7){
      ResToUse = Res7
    }
  
    if (i == 8){
      ResToUse = Res8
    }
  
    if (i == 9){
      ResToUse = Res9
    }
  
    if (i == 10){
      ResToUse = Res10
    }
  
    if (i == 11){
      ResToUse = Res11
    }
  
    if (i == 12){
      ResToUse = Res12
    }
  </code></pre>