How to print an objects name

So Im cycling trough a table coming from datastorage but I dont know how to get the objects name. Heres the code:

local test = {["Cat"] = 3, ["Dog"] = 1}
for i,v in pairs(test) do
	print(v)
end

How can I make it so it prints (Dog/cat) inside the for loop?
Sorry im not 100% english and I dont know much about programming expressions

you would do print(i)

in a for loop, the i stands for index and the v stands for value

Oh my god I am a dumbass. Obviously its i xD
Thank you and sorry for wasting your time hahaha <3

dont worry about it man. happy to help lol

2 Likes