Lua Programming/How to Lua/type

The type function gives the datatype name of a given valueEdit

print(type("banana"))    -- returns "string"
print(type(3.5))         -- returns "number"
print(type(true))        -- returns "boolean"
print(type(print))       -- returns "function"
print(type(nil))         -- returns "nil"
Last modified on 1 February 2011, at 00:22