I've made an example of what I'm trying to convey and I don't know why it's not working as expected.
local tab = {["key"] = nil}
for k, v in pairs(tab) do
print(v)
end
What I expect it to do is print nil since the value of the key is nil, but what it's doing is print completely nothing at all. However, if I do set the value to something else other than nil, it functions as expected and prints the value.
local tab = {["key"] = "hi"}
for k, v in pairs(tab) do
print(v)
end
-- prints "hi"
Directly printing the value from the table like tab.key seems to print nil so why doesn't iterating through the table not work?
