What's wrong with this code?

javascript

#1

When I run the code it says "SyntaxError: missing after for-loop initializer". What's the problem?

My code:

for (var a = 1, a < 10, a++) {
for (var b = 0, b < 10, b += 2) {
for (var c = 0, c < 10, c++) {
for (var d = 0, d < 10, d += 2) {
for (var e = 0, e < 10, e += 5) {
for (var f = 0, f < 10, f += 2) {
for (var g = 0, g < 10, g++) {
for (var h = 0, h < 10, h +=2) {
for (var i = 0, i < 10, i++) {
if(a != b != c != d != e != f != g != h != i && (a + b + c) % 3 === 0 && (10 * c + d) % 4 === 0 && (d + e + f) % 3 === 0 && (1000000 * a + 100000 * b + 10000 * c + 1000 * d + 100 * e + 10 * f + g) % 7 === 0 && (100 * f + 10 * g + h) % 8 === 0 && (a + b + c + d + e + f + g + h + i) % 9 === 0) {
console.log(a, b, c, d, e, f, g, h, i)
}
}}}}}}}}}


#2

HI you should separate each statement inside the for loop with a Semicolon like that

for ( statement1; statement2; statement3) {

}

#3

Thank you, it works now! :smiley: