function randArr(){ let arr = []; let arrLength = 100; for(let i = 0; i< arrLength; i++){ let rand = 0; let isSame = false; do{ rand = parseInt(Math.random()*100000); isSame = false; let stringRand = rand.toString().split("") for(let j = 0; j < stringRand.length; j++){ if(stringRand[j] == stringRand[j+1]){ isSame = true } } } while(isSame || rand < 10000) arr.push(rand) if(i == arrLength-1 && [...new Set(arr)].length<100){ arrLength++; } } return arr } randArr()