Append an integer to a string name
<p>Hi Im trying to iterate through a for loop from a long string of words held in a single string(wordlist), within impactjs:</p>

<pre><code>var wordlist3 ="hellwhentrysthisbreaks"
var  xc=3;
var word_length = 4;
var words_in_round = 4;             
for ( i=0; i&lt;words_in_round; i++){        
    var num_words = ['wordlist' + xc].length / word_length;
    var random = Math.floor(Math.random() * ((num_words+1) - 0 ));
    n = Math.round(random / word_length) * word_length;
    random_word =(['wordlist' + xc].substring(n,(n+word_length)))
    random_words += random_word;
}
</code></pre>

<p>The above code works if i define wordlist as a global, but when i made it local num_words is not defined properly and random word throws this object has no method substring ..</p>

<p>My problem is, that since i converted to local variables when i append the string name and call .length it gives me the length of the new name (wordlist3.length = 9) instead of the length of wordlist3 =20 .. also i cant call the method substring on this object ...</p>
