for i,v in ipairs(t) do
--code
end
This means that for every (i)ndex and (v)alue in (numerically indexed)pairs(table) do some code.
The value ( i ) is in reference to the numerical value of the index(item number in the table).
The value ( v ) is in reference to the value stored in the index(this could be another table, a variable, a function, etc…)
Of course, these reference names are arbitrary, but I like to use i,v because they are easy to remember.
The difference with pairs and ipars is that ipars will work with numerically assigned indices only, and the pairs will work with all indices. A numerically assigned index is automatically assigned if no index value is assigned. so for the below table, t[1] would be "apple".
t = {"apple", "orange", "banana"}
Alternatively, you can define a table index with a variable name.
t = {apple = "apple", orange = "orange", banana = "banana"}
You would just call back to that value by using t.apple and it would return the same thing as t[1] earlier.
I could go on about tables, indices, and pairs, but it would be too much for me at this hour….