0
How do i use i,v in pairs()
Help
2 Answers
0
On each iteration, the for loop calls its iterator function with two arguments.
See this example :
a = {"one","two","three"}
for i, v in ipairs(a) do
print(i, v)
end
0
A = {
"This" = "that",
"That" = "this"
}
For I, v in pairs(A)
--code here
End
Its generally used for dictionaries.
I is the key/index of it, so in this case the first item's key is "this" and the second's is "that". V is value.