What is ipairs used for

When I test them out in studio they replicate the same thing. Is there a deference?

ipairs is used for iterating a tables that aren’t dictionaries, which is an array. pairs is used for dictionaries. There’s a lot of tutorials out there explaining this already.

If I use ipairs for dictionaries they work the same as pairs()

It does, but it’s highly encouraged you use pairs instead.

There is no difference? I should just use pairs because for no reason

There is difference.

2 Likes
local t = {a = "b", c = "d"}
for i, v in ipairs(t) do
    print(i, v)
end

Doesn’t print anything