+ 2

pls explain this code!

var count = 0; for(i = 0; i < 3; i++){ for(j = 3; j>0; j--){ ++count; document.write(i + "<br>"); } } document.write(++count);

29th Oct 2017, 6:59 AM
ARB
ARB - avatar
3 Answers
+ 6
If you don't know yourself after achieving the JS course, you need to redo it more closely ^^
29th Oct 2017, 7:06 AM
visph
visph - avatar
+ 4
increment: i++ is equivalent of i += 1 wich is equivalent to i = i+1 ++i is same, but incrementation done before use of x value (if used in the left part of an assignement for example) loop: for (i=0; i<3; i++) have three distinct 'arguments' part separated by semi-colon: > i = 0; initialize a counter, done only at begin of loop > i < 3; test of the counter, done before each iteration > i++; incrementation or anything to do at end of each iteration
29th Oct 2017, 7:29 AM
visph
visph - avatar
+ 2
@visph I'm learning everyday. problem is I've no teacher except w3school and sololearn. that's why frequently I asked here. if you know answer write down otherwise....
29th Oct 2017, 7:21 AM
ARB
ARB - avatar