I have the following script:
Timer=0;
function countdown(auctionid){
var auctions;
var divs;
Timer=Timer+1;
if((Timer%10==\"0\")||(Timer==\
See the answers to this question which also allows you to set the seed value.
You want to use the random() function. There is no version that returns an integer unfortunately, only a float between 0 and 1, so you'll need to do a few operations. Try the following:
var randomNum = Math.floor(Math.random() * 10) + 2;
This should generate a random integral number between 2 (inclusive) and 12 (exclusive). Change 10 to 11 if you want the 12 to be inclusive, of course.
Using the Web Crypto api.
console.log(
crypto.getRandomValues(new Uint32Array(1))[0] ,
crypto.getRandomValues(new Uint16Array(1))[0] ,
crypto.getRandomValues(new Uint8Array(1))[0]
)
https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues https://caniuse.com/#feat=cryptography