I'm doing a Euler challenge that is stating to find the smallest positive number that is divisible (without a remainder) by all numbers from 1 to 20. So I did it however, I don't like the fact that I have to guess up to which number the while loop have to go (var s.... s < 303000000) and I guess there are too many variables. I'm sure I could get rid of 's'.
var s = 0;
var n = 1;
while (s < 303000000) {
for (var i=1;i<21;i++) {
if (n % i != 0) {
break;
}
if (i == 20) {
console.log(n);
}
}
n += 1;
s += 1;
}