Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript get random array value

const months = ["January", "February", "March", "April", "May", "June"];

const random = Math.floor(Math.random() * months.length);
console.log(random, months[random]);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #random #array
ADD COMMENT
Topic
Name
9+8 =