I've never really understood why people choose to use next over pairs and vice versa. Was hoping to find an answer here, thanks. :)

3 comments

0

I think pairs is better, The last time I used next, I cant make I wanted.

0

Imo it's up to personal preferance. However, interestingly, pairs uses next. https://www.lua.org/pil/7.3.html

0

I've never used next directly... always pairs. Locking this question since it can technically be closed, but at the same time not. (Also, you got your answer)