The first method only works with tables that aren’t dictionaries. What do I mean with this? A dictionary is a table that has non-numeric keys. For example, local dict = {a = 1, b = 2}. Since you can’t use the length property on a dictionary, you should use the second method instead.