randomize array javscript code example
Example 1: js shuffle array
yourArray.sort(function() { return 0.5 - Math.random() });
Example 2: random array javascript
const months = ["January", "February", "March", "April", "May", "June", "July"];
const random = Math.floor(Math.random() * months.length);
console.log(random, months[random]);