WoW:API type

From AddOn Studio
Revision as of 23:02, 25 March 2010 by WoWWiki>Starlightblunder ({{luaapi}})
Jump to navigation Jump to search

WoW Lua

This function returns the type of variable was passed to it.

t = type(arg1);

Arguments

arg1
Any - Value to query the type of.

Returns

t
String - String representation of the argument's type passed: "nil", "number", "string", "boolean", "table", "function", "thread", or "userdata".

Example

type("I am a string"); -- "string"
type(45); -- "number"
type({}); -- "table"
type(nil) -- "nil"