Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript array randomizer

var demo = document.getElementById("demo");
var fruits = [
"Apple",
"Orange",
"Mango",
"Grapes",
"Banana",
];

demo.innerHTML = fruits[Math.floor(Math.random() * fruits.length)];
Source by rashidtoo.netlify.app #
 
PREVIOUS NEXT
Tagged: #javascript #array #randomizer
ADD COMMENT
Topic
Name
2+3 =