How do I make this simple for loop increment by 10?


#1

So this works, it adds 1 each time…
for (var poop = 1; poop < 100; poop++) {
console.log (poop);
}

But why doesn't this work, I want to add 10 rather than just one, but it freezes my browser!
for (var poop = 1; poop < 100; poop + 10) {
console.log (poop);
}


#2

Your not using the right itteration... instead of the itteration you posted:

Its suppose to be

poop = poop + 1

Or...

poop+=1

#3

I want to add 10 each time, not 1 though. :fearful:


#4

Oh so thats easy you just do :slightly_smiling:

poop+=10