random index of an arry js code example
Example 1: get random element from array js
var item = items[Math.floor(Math.random() * items.length)];
Example 2: get random entry from array javascript
const rnd = (arr) => { return arr[Math.floor(Math.random() * arr.length)] };