How does it works?


#1

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

///////////////////////////////////////////////////////////////////////
The problem is that whenever I run this code the 8 doesn't appear, so then if a I change the order of the increment or the start of the loop 12 can't appear.
So I wanna know how can I write my code for both 8 and 12 appear when print.


#2

You're incerementing in two places right now, that's an easy way to confuse the reader and perhaps yourself as well.


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.