Jump to content
Toggle menu
  • 17.3K articles
  • 8.2K files
  • 5 users
  • 280.7K edits
WoW Classic Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
type -Documentation by Darjk-

Native Lua statement:

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

var = type(arg1);

Parameters

Arguments

(arg1)
arg1
Any - arg1 can be any variable, String, Integer, etc.

Returns

Returns
var
var
String - Contains the type of variable was passed as the argument. ie. "String", "Number", etc.

Example

local a = "I am a string";
local b = 45;
local c = type(a);
local d = type(b);


Result

c = "string"
d = "number"

Details

This function is part of the core lua language.
Possible return values (all strings):
"nil", "number", "string", "boolean", "table", "function", "thread", and "userdata".

Template:LUA