title: Get value of variable in javascript, which is combination of other two variable
body: <p>I created variables in java script via loop as</p>
  
  <pre><code>var option1="some value 1";
  var option2="some value 2";
  var option3="some value 3";
  </code></pre>
  
  <p>Now If <code>val=2</code> (val depends upon user input it may 1,2 or 3). I have to print <code>option1</code>, <code>option2</code>, <code>option3</code> accordingly.</p>
  
  <pre><code>var finalopt="option"+val;
    alert(finalopt);
  </code></pre>
  
  <p>now output is (<code>option2</code>)
  I want output as (some value 2) because value of option <code>2</code> is some value <code>2</code>.</p>