type

Returns the type of a variable

Prototype

s = type (v)

Description

Returns a string, which is the type of the supplied variable:

print (type (42)) --> number
print (type ("42")) --> string
print (type (string)) --> table
print (type (tonumber)) --> function
Note that if its argument is nil, it returns "nil" - that is the string containing the word "nil".

Lua functions

Topics