title: How do I get random values from an array a set amount of times?
body: <p>I made this function to get random values from an array : </p>
  
  <pre><code> game.colors = [red,green,blue,yellow];
   game.computerMoves = [];
  function random () {
    let moves = game.colors[Math.floor(Math.random() * game.colors.length)]
    game.computerMoves.push(moves);
    return game.computerMoves;
  }
  </code></pre>
  
  <p>But I want to be able to get a different amount of random values from this function, for example if I use an argument to get 6 random values from the array or 9 random values that I can change. How can I do this? Right now for example if I wanted 9 random values I would have to activate this function 9 times to get them, but I want to be able to get those by activating this function once. </p>