Answers for "js random item in list"

16

javascript how to get a random element from an array

var items = ['Yes', 'No', 'Maybe'];
var item = items[Math.floor(Math.random() * items.length)];
Posted by: Guest on March-19-2020
0

js get random element in array

var item = items[Math.floor(Math.random()*items.length)];
Posted by: Guest on July-25-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language