Referencing a JavaScript variable
<p>I have 2 variables in a script tag that get populated with string values. 
I also have an <code>.each</code> loop that goes through each select box I have on the page. I want a way to append the index value of the loop to the name of the variable, and retrieve its value.</p>

<pre><code>var secQuestion1 = "bla"
var secQuestion2 = "bla"

    selectbox.each(function( index ) {
       var question = ['secQuestion' + (index+1) ];
       console.log("question = ", ['secQuestion' + (index+1)] )
    });
</code></pre>

<p>I thought I might be able to use bracket notation to retrieve the value. 
Any ideas on how to do this, so on each index in the loop I would get my questions values?</p>
