/**
* Gets random int
* @param min
* @param max
* @returns random int - min & max inclusive
*/
getRandomInt(min, max) : number{
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min + 1)) + min;
}
function GetRandom(max){
return Math.floor(Math.random() * Math.floor(max))
}
GetRandom(3); //returnval 0, 1, 2
//Random Number Between 1 to 10.Change (10), for an increased or decreased values..
let varibleNem = Math.floor(Math.random() * 10)+1;
console.log(varibleNem);
//-----------
//Try Changing the 10, to 1000 it will give u a value between 1 to 1000...
//Taken from here ( https://youtu.be/1Rq_LrpcgIM?t=148 )
function randint(low:number, max?:number) {
return Math.floor(Math.random() * 10) % (max ?? low) + (max ? low : 0);
}