Can you not use pairs, ipairs in iteration loops?

I’ve always been wondering if its required to use ipairs or pairs in iteration loops. I understand pairs is used for dictionary while ipairs are used in array table structures but I often see examples of people not using pairs or ipairs just like the example shown:

image

In the following code it doesn’t use ipairs or pairs in the code. It is located in the Roblox documentation so I am sure this code is valid.
Parallel Luau | Documentation - Roblox Creator Hub

1 Like

It’s not necessary anymore

1 Like

This is called generalized iteration, which is a feature of Luau. Personally, I still use pairs and ipairs in my code for clarity, but you don’t need to use them anymore.

4 Likes

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