Search found 1 match

by devilkitten
Thu Apr 08, 2021 7:13 am
Forum: The Art of Webteasing
Topic: EOS help - random numbers
Replies: 7
Views: 2591

Re: EOS help - random numbers


So, in this case, you'd put this in your init script:
function randomIntFromInterval(min, max) { // min and max included
return Math.floor(Math.random() * (max - min + 1) + min);
}

Then later, you use it via:
var myNumber = randomIntFromInterval(50, 200);
console.log('The number is %s ...