title: Functional approach to basic array construction
body: <p>This is my code, acting upon <code>myArray</code>:</p>
  
  <pre><code>var myArray = [];
  var i;
  
  for(i = 0; i &lt; 20; i += 1) {
     myArray.push(Math.random());
  }
  </code></pre>
  
  <p>Is there a functional equivalent of the above that does without the dummy variable <code>i</code>?</p>
  
  <p><em>Favorite answers</em>:</p>
  
  <ul>
  <li><code>while(myArray.push(Math.random()) &lt; 20);</code></li>
  <li><code>$.map(Array(20), Math.random);</code></li>
  <li><code>for(var myArray = []; myArray.push(Math.random()) &lt; 20;);</code></li>
  </ul>