dimanche 7 février 2021

Generating pseudoRandom number less than 7 in javascript

var x = Math.floor(Math.random() * 7); var y = Math.floor((Math.random() * 6) + 1);

Which one is correct and why??




Aucun commentaire:

Enregistrer un commentaire