Find the first item of a dictionary

You can use the next function to retrieve the first item the dictionary iterator will iterate through:

local a = {}
a["test"] = 5
a["asdjh"] = "something"

local key, value = next(a, nil)
print(key, value)
23 Likes