var textArray = [
'song1.ogg',
'song2.ogg'
];
var randomNumber = Math.floor(Math.random()*textArray.length);
const randomElement = array[Math.floor(Math.random() * array.length)];
pick random string from array javascriptJavascript By Joyous Jackal on Jun 14 2020
var groceries = [
'milk',
'coriander',
'cucumber',
'eggplant'
]
let mygroceries = groceries[Math.floor(Math.random() * groceries.length)]
console.log(mygroceries)//This gives you any string from groceries
Math.random().toString(36).substr(2, 5);