title: Create an array with random values
body: <p>How can I create an array with 40 elements, with random values from 0 to 39 ?
  Like</p>
  
  <pre><code>[4, 23, 7, 39, 19, 0, 9, 14, ...]
  </code></pre>
  
  <p>I tried using solutions from here:</p>
  
  <p><a href="http://freewebdesigntutorials.com/javaScriptTutorials/jsArrayObject/randomizeArrayElements.htm" rel="noreferrer">http://freewebdesigntutorials.com/javaScriptTutorials/jsArrayObject/randomizeArrayElements.htm</a></p>
  
  <p>but the array I get is very little randomized. It generates a lot of blocks of successive numbers...</p>