Answers for "randomize array javscript"

14

js shuffle array

yourArray.sort(function() { return 0.5 - Math.random() });
Posted by: Guest on April-03-2020
-1

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]);
Posted by: Guest on February-22-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language