Why does this not work, exactly?

QuestionForLoop

Hi

So michael said there’s two ways how one can write a for loop.

In the challenge where one had to write a nested for loop, i’ve chosen the way as it is displayed in the picture i’ve uploaded.

it doesn’t work.
i’ve got my suspicions that is has something to do with scope?

Thanks in advance for any answers. :slight_smile:

Yes, you are continually increasing Comparison. If you have it in the loop it would be destroyed at the end of it’s scoped and then reinitialiseds to Index + 1 on the next iteration of Index

aaaaaaaah, i see it now, thanks. :slight_smile:

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

Privacy & Terms