Skip to content
everloot

Lore archive · Warcraft Wiki, 2023 dump

API pairs

Last wiki revision 2022-07-21

Returns an iterator triple that allows for loops to iterate over all key/value pairs in a table. iteratorFunc, table, startState = pairs(table);

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.

Source

https://warcraft.wiki.gg/wiki/API_pairs · retrieved 2023-11-13 · CC BY-SA 4.0

Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.

This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.