Replies: 1 comment
-
Yeah, I've known for a while but kept using them out of habit/style preferences but have started moving away from using them. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It used to be that next would make loops more performant.
However with Luau this is no longer the case and the opposite is true.
Use ipairs() for arrays and pairs() for dictionaries.
Also next is less idiomatic
Basically use ipairs() unless it has custom indexes then use pairs()
For normal tables use ipairs()
Beta Was this translation helpful? Give feedback.
All reactions