title: How to pass the random numbers from an array to get each object property from an array of objects?
body: <p>I have generated unique numbers from 1 to 3:</p>
  
  <pre><code>let arrayOfNums = [];
  
  while (arrayOfNums.length &lt; 3) {
    let r = Math.floor(Math.random() * 3) + 1;
    if (arrayOfNums.indexOf(r) === -1) arrayOfNums.push(r);
  }
  console.log(arrayOfNums);
  </code></pre>
  
  <p>I have another array of 3 objects:</p>
  
  <pre><code>colors = [
    {
      name: "red",
      colorValue: "red",
      label: "r",
    },
    {
      name: "yellow",
      colorValue: "yellow",
      label: "y",
    },
    {
      name: "blue",
      colorValue: "#0077FF",
      label: "b",
    },
  ];
  
  let randomNumber;
  colors[randomNumber].colorValue
  </code></pre>
  
  <p>How do I loop through every element inside <code>arrayOfNums</code> and then pass each element (or int) onto the object getter (<code>[randomNumber]</code>) to get every colorValue randomly? </p>
  
  <p>Please help me 'cause I'm kind of new in Javascript and I really don't know how to do this. It's so complex so please help. Thanks a lot in advance!</p>