0
Having problems understanding nested for loops please help. Why is this code producing 12
var b =0; for( var i = 0; i<=2 ; i++) { for(var j =0; j<=3; j++) { b++; } }
1 Antwort
+ 8
For every iteration of the outer loop, the inner loop runs 4 times from 0 to 3. So the outer loop runs 3 times from 0 to 2. So 4*3=12.