Quantcast API type - WoWWiki - Your guide to the World of Warcraft
Recent changes Random page
GAMING
Gaming
 
StarCraft Wiki
Super Smash Wiki
Halopedia
Diablo Wiki
FFXIclopedia
Grand Theft Wiki
See more...

API type

From WoWWiki

Jump to: navigation, search

Native Lua statement:

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

var = type(arg1);

Contents

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".


 


This is a Lua function and documented as part of the World of Warcraft API

Rate this article:
Share this article: