How would I get this ["e"] = "FoodStand"
from a table, not just what the “e” is but the whole thing ["e"] = "FoodStand"
local randomtable = {}
for _,v in pairs(randomtable) do
if v then
print(v)
end
How would I get this ["e"] = "FoodStand"
from a table, not just what the “e” is but the whole thing ["e"] = "FoodStand"
local randomtable = {}
for _,v in pairs(randomtable) do
if v then
print(v)
end
When using pairs() on a dictionary i is going to be the key and v is going to be the value
so
local dictionary = {
["a"] = "something",
["b"] = "something else"
}
for i, v in pairs(dictionary) do
print(i, v)
end
--[[ output
a something
b something else
--]]