CREATE AN ARRAY WITH THE THREE RANDOM ELEMENTS

PHOTO EMBED

Tue May 23 2023 13:34:05 GMT+0000 (Coordinated Universal Time)

Saved by @Antjrobles #javascript

const colors = ["blue", "red", "cyan", "yellow", "orange", "black", "white", "pink", "green", "purple"];
const randomColors = [];

for (let i = 0; i < 3; i++){
      const randomNumbers = Math.floor(Math.random() * colors.length);
      randomColors.push(colors[randomNumbers])
};

console.log(randomColors);
content_copyCOPY