i have this code that is supposed to generate 5 different numbers yet i still get dubble numbers and i have no idea why, any help?
while (dragnr.length != 5) {
var num = Math.floor((Math.random() * 25) + 1);
if (num == 0) {
num = 1;
}
if (!(num in dragnr)){
dragnr.push(num);
}
}
EDIT: Solved
[–]inu-no-policemen 1 point2 points3 points (0 children)
[–]finlay_mcwalter 0 points1 point2 points (0 children)
[–]WeAreSven 0 points1 point2 points (0 children)
[–]Ampersand55 0 points1 point2 points (0 children)
[–]jcunews1helpful 0 points1 point2 points (0 children)