var luckyNumbers1 = [1, 2, 3, 4, 5, 6, 7];
var luckyNumber1 = luckyNumbers1[Math.floor(Math.random () * 7)];
console.log ("Your winning numbers are " + luckyNumber1 + ", " +
luckyNumber1 + ", " + luckyNumber1 + "!");
Why do I get the same set of numbers? I noticed that if I do more luckyNumbers the sets will be different. But how come Javascript uses only 1 method to randomize the number of this variable? e.g. :
" Your winning numbers are 1, 1, 1!"
" Your winning numbers are 5, 5, 5!"
thanks, Happy coding!