pairs is built to be used for iteration over dictionaries, ipairs for contiguous arrays with numerical indices.
There’s more