## Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

### Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today. # Confused on the for loop, declaring "i". Want to ensure I am understanding.

So I am trying to understand why dave has used the following when creating a for loop. I think I am just having an issue grasping for loops and the reason why we are using "i", is it just arbitrary to initialize the loop? Dave used below. I was able to do this challenge with if, and else if. I started with a for loop, but got confused half way through.

```for (var i = 0; i < questions.length; i += 1) {
question = questions[i];
response = parseInt(prompt(question));
```

If I am getting this correctly, we are

1. creating variable i making it 0
2. checking if i is less than questions array length, it is, so run code below
3. making question equal to questions array index of [i, at the moment 0]"
4. adding 1 to i so it stops after getting to a length longer than the array indexes
5. making answers = questions array index [i, at the moment 0]
6. making response = prompt(question)

Then it runs again, increasing i, thus moving the question over one index, the answer over one index, and again. So my understanding is that we use i to start the loop and set to zero, and it allows us to use [i] in place of the actual index number to iterate through each variable in the loop? As i increases, it automatically adjusts the rest of code to that value?
Thanks for help!