Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia
Advertisement

Returns an iterator triple that allows for loops to iterate over all key/value pairs in a table.

iteratorFunc, table, startState = pairs(table);

Example[]

local random_array = { mug = "coffee", [42] = "universe", testboolean = false }

for index,value in pairs(random_array) do 
  DEFAULT_CHAT_FRAME:AddMessage(tostring(index).." : "..tostring(value))
end

Result:

 mug : coffee
 42 : universe
 testboolean : false

would be output to the chat window.

Advertisement