Answer the question
In order to leave comments, you need to log in
Why is the variable i on the first iteration in the outer loop equal to 2, while in the inner it is already 3?
for (var i = 2; i <= 10; i++) {
for (var j = 2; j < i; j++) {
}
}
Answer the question
In order to leave comments, you need to log in
Because on the first pass of the outer loop, the inner one is not executed even once, since 2 < 2 -> false is
your cap.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question