Answers for "how to generate a random number in javascript different each time"

4

javascript get random integer in given range

const randomInteger = (min, max) => Math.floor(Math.random() * (max - min + 1)) + min;
Posted by: Guest on July-03-2020
0

javascript generate 3 numbers 1 - 49

var arr = [];
while(arr.length < 8){
    var r = Math.floor(Math.random() * 100) + 1;
    if(arr.indexOf(r) === -1) arr.push(r);
}
console.log(arr);
Posted by: Guest on April-14-2020

Code answers related to "how to generate a random number in javascript different each time"

Code answers related to "Javascript"

Browse Popular Code Answers by Language