Number with dissimilar digits

javascript

#1

Hello!

How can I tell the for loop, to only look at the numbers which has dissimilar digits?
My code looks like this:

for(var i = 100000000; i < 1000000000; i++) {
if(i.toString().substring(0, 2) % 2 === 0 && i.toString().substring(0, 3) % 3 === 0 && i.toString().substring(0, 4) % 4 === 0 && i.toString().substring(0, 5) % 5 === 0 && i.toString().substring(0, 6) % 6 === 0 && i.toString().substring(0, 7) % 7 === 0 && i.toString().substring(0, 8) % 8 === 0 && i.toString().substring(0, 9) % 9 === 0 && ) {
console.log(i)
}
}


#2

@dobak2000,
Try it with

for (var i = 100; i < 123; i++) {
    var iString = i.toString();
    var strLen = iString.length;
    var tArray=[];
    var doublet = 0;
    for (var j=0; j< strLen; j++) {
      if (tArray.indexOf(iString[j]) < 0) {
          tArray.push(iString[j]);
      }
      else {
          doublet =1;
          
      }
    }
    if (doublet===0) {
        console.log(tArray.join(""));
        console.log("===");
        
    }
}