title: JS: How Do I make this script smaller. Random object
body: <p>Been learning Javascript through some tutorials the last couple of months (code academy/ free code camp etc) and want to use what I've learnt to build something on my own.</p>
  <p>I've built a Random number generator that pushes 5 random numbers into an object with 5 empty arrays in it. The script works. But I think it could be cleaner and a lot less code. I'm just not sure how to do that.</p>
  <p>Any advice here would be greatly appreciated, as I'm still learning.</p>
  <p>(I've realised that there is also a bug in here that would mean there's a chance that one of the &quot;tickets&quot; has a duplicated number in it. - need to address that at some point {haha} )</p>
  <p>here's my script:</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 RanNum(max) {
      return Math.floor(Math.random() * max)
  }
  const LOTO_ARRAY = 5;
  const lotto1Array = [];
  const lotto2Array = [];
  const lotto3Array = [];
  const lotto4Array = [];
  const lotto5Array = [];
  
  for (let i = 0; i&lt;LOTO_ARRAY; i++){
      lotto1Array.push(RanNum(56))
      lotto2Array.push(RanNum(56))
      lotto3Array.push(RanNum(56))
      lotto4Array.push(RanNum(56))
      lotto5Array.push(RanNum(56))
  }
     
  
  var ticket = {
      "ticket one" : [],
      "ticket two" : [],
      "ticket three" : [],
      "ticket four" : [],
      "ticket five" : []
  };
  
  ticket["ticket one"] = lotto1Array
  ticket["ticket two"] = lotto2Array
  ticket["ticket three"] = lotto3Array
  ticket["ticket four"] = lotto4Array
  ticket["ticket five"] = lotto5Array
  
  console.log(ticket);</code></pre>
  </div>
  </div>
  </p>