I have to generate 3 random numbers from 0-9 every 2 seconds, it works however there will be instances where i get duplicate values for example 4 7 7 . It would be great is someone could point out my mistake, thanks
if (firstNum == secondNum || firstNum == thirdNum) {
firstNum = Math.floor((Math.random() * 9) + 1);
} else if (secondNum == firstNum || secondNum == thirdNum) {
secondNum = Math.floor((Math.random() * 9) + 1);
} else if (thirdNum == firstNum || thirdNum == secondNum) {
thirdNum = Math.floor((Math.random() * 9) + 1);
}