Math.random Propriété de Math Retour: Number entre 0 (inclus) et 1 (exclus) Exemple: var r = Math.random() Fonction utile: randomInt: function randomInt(a, b) { return Math.floor(Math.random()*(b-a+1)+a); } Exemple: randomInt(1,5) // retourne un nombre entre 1 et 5 (inclusif)