6 how does it work


#1

start counting from 8 and
i count up by 12
yes i do it but still not working

for (var i = -4 ; i < 120;) {
console.log(i += 12);
}


#2

Hi I think that it should be like that

for (var i = -4 ; i < 120; i += 12)

And inside the console.log just put "i"


#3

wizmarco Thank you so much !! :slightly_smiling:


#4

Actually this approach is not as bad as it might look like, as you're allowed to leave up to all parts of the for loop empty as long as you do the stuff elsewhere. The problem here is probably that this is one loop ahead as the first loop is expected to be i = -4 whereas here it is already -4+12.


#5

Im stuck on the same lesson, i've tried also with your solution
for (var i = -4 ; i < 120; i += 12){
console.log(i);
}
but the system is telling me "Oops, try again. Did you remember to count up by 12s?" even though the results start from 8 and are shown as they should.


#6

I have the same problem.

I fixed it

for (var i = -4; i < 108;) {
console.log( i += 12);
}


#7

for (var i = 8 ; i < 117; i += 12) {
console.log(i);
}