As with any array you either get them in order ..
Lua Code:
for i = 1,5 do
print(items[i])
end
or select them by index
or select them by key if they are not in sequential index order
If you want to go through a list and print certain ones you will need an additional check, using some set of if statements that will tell you if that item is the one that fits the bill. In this example the items table contains a class name to signify that item is for priests only. So if you want to print off all those items suitable for priests then you would do that test. How you would use this all depends on what information your data includes.
Lua Code:
for i = 1,5 do
if items[i].class == "priest" then
print(items[i])
end
end
This is a link to how tables work in lua which is the equivalent to arrays
https://www.lua.org/pil/2.5.html