title: Choosing a random value from an array gives undefined
body: <p>When I Input the first number to be for example 5 and the second Number to be like 10 I get undefined. I tried <code>alert(array);</code> to see the contents of it but there was nothing and hence undefined. It works for other numbers like 1 to 9. Why does it give me an undefined value from range 5 to 10? I just want to make a random number chooser where you will input the first number and the second number and a random number will be given to you?</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 promptUser() {
    var first = prompt("First number?");
    var second = prompt("Second number?");
    var array = [];
    //Make a range from First number to last number then choose a random number
    for (x = first; x &lt;= second; x++) {
      array.push(x);
    }
    alert(array);
    randomInt = Math.floor(Math.random() * array.length);
    alert("The random number is " + array[randomInt]);
  }</code></pre>
  </div>
  </div>
  </p>