Skip to main content

type

Function type 

Source
pub fn type(v: any) -> string
Expand description

Returns the type of its only argument, coded as a string. The possible results are "nil", "boolean", "number", "string", "table", "function", "userdata" and "thread".

§Examples

print(type(nil))         --> nil
print(type(42))          --> number
print(type("hi"))        --> string
print(type({}))          --> table
print(type(print))       --> function