js random string from array

JavaScript
const randomElement = array[Math.floor(Math.random() * array.length)];
Source

Also in JavaScript: