Answers for "get 3 random element from list javascript"

1

how to get a randome element from a list in javascript

let numList = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
let randomElem = numList[Math.floor(Math.random() * numList.length)];
console.log(randomElem);
Posted by: Guest on March-30-2021

Code answers related to "get 3 random element from list javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language