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
1function randomArrayStr(maxWordLength,arrayLength = false){
2 const arr = []
3 while(arrayLength){
4 arr.push(Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, maxWordLength))
5 --arrayLength
6 }
7 return arr
8}