Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialRobert Kwiat
5,349 PointsWhat does "i" mean?
Hi, I am confused about why he made the variable "i". What is it and what is it's purpose? Can you make it anything you want, such as "e" or "q" or does it have to be "i". Thanks for your input!
2 Answers
Blake Webster
5,901 PointsI've generally always used i in my programming as well and I always took it to mean i = incremental value. It can technically be whatever you want it to be, it is just a variable to use during a loop. So in your example: "e" or "q" would also work if that makes more sense for you! Andrew Chalkley is right though, most programmers use "i" in their loops.
Andrew Chalkley
Treehouse Guest TeacherYou can use anything.
Most programmers use i
in loops. I think it can mean a number of things like it's type an integer
or even an index
of the array you're cycling over.