So I've been trying to learn Lua lately and all of it's made sense so far. I've gotten into some of the intermediate things but am still stuck on some of the basics that I can't find any information that makes sense for me on. So I understand the for loop like the one that goes like

for i = 1, 10 do

that for loop is simple and makes sense to me, the one I don't understand is

for _, i in ipairs do

I don't understand that one that well, like I understand some things like I know the i stands for iterator and stuff but sometimes it's v or k (v probably stands for value BUT K??) and also what the heck is the _,? ALSO what does it mean by pairs? Is that just something that's needed or what does it mean, and sometimes it's also ipairs... what's the difference? Thanks guys if you answer this, I just can't seem to find any information on this anywhere on wiki that I actually understand so I decided to come here.

1 comment