What's the index variable?

I keep on using a variable called index in all of the scripts but I’m confused on what it means and what it’s actually doing.

Show me an example of what you’re asking.

Hi BenCour,

Generally, variables do not do anything but storing a value. Variables are used in a context to get a “higher meaning”. Without any context, they do not have any purpose within your project.

Variable names are “arbitrary”. In programming, the term “index” usually refers to a collection, for example, an array or a List. If you want to access an element in an array or a List, you do that via the index. 0 is the first index.

Gary named his variable accordingly. However, he could have named it abc, and his code would have worked the same.

Did this clear it up for you?


See also:

1 Like

Yup thanks.

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

Privacy & Terms