1//get random value from array
2var colors = ["red","blue","green","yellow"];
3var randColor = colors[Math.floor(Math.random() * colors.length)];
4
1var colors = ["red","blue","green","yellow"];
2var randomColor = colors[Math.floor(Math.random()*colors.length)]; //pluck a random color
3
1// how to generate random words from an array
2const Coins = ["Heads","Tails"]
3let Generate = Math.floor((Math.random() * Coins.length));
4
5console.log(Coins[Generate]) // this will print the outcome