'undefined' result for variable in Javascript function
<p>something in my code is meaning that I am getting an array printed which contains only undefined values, not the random numbers I am expecting.  </p>

<p>My code is below: </p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>function List(max, min, numLists, numItems) {
    this.max = max,
    this.min = min,
    this.numLists = numLists,
    this.numItems = numItems,
    this.generateLists = function () {
        var fullArray = [];
        var completeArray = [];

        for (i = this.min; i &lt; this.max; i++) {
            fullArray.push(i);
        }
        for (i = 0; i &lt; numItems; i++) {
            var randomItem = Math.floor(Math.random() * (1 + (this.max - this.min)));
            completeArray.push(fullArray[randomItem]);
        }

        console.log(completeArray);
    }
}

var newList = new List(12, 100, 1, 15);

newList.generateLists();</code></pre>
</div>
</div>
</p>

<p>The code is supposed to print a random list of number between the min and max values. I'm getting an array with 15 values in, but they are all undefined. I'm guessing this mean there is something wrong with my first 'for' loop? </p>

<p>If anyone has any suggestions on how I could make this better please do criticise!</p>

<p>Thanks in advance. </p>