Types

< what is a type per definition >

boolean
The boolean is a data type that has one of two possible values (denoted true and false) which is intended to represent the two truth values of logic and Boolean algebra. print(type(true))             -- boolean

function
A function is a sequence of program instructions that performs a specific task, packaged as a unit. print(type(function end))   -- function

nil
print(type(nil))              -- nil

number
print(type(58), type(-8.9))   -- number

string
print(type("Hello, World!"))  -- nil

table
print(type({"2", 3, "b"}))    -- table

thread
k = coroutine.create(function     -- Do anything in this coroutine. end) print(type(k))                -- thread

userdata
print(type(vec2(5, 5)))       -- user data

Function type
The type-function takes anything as an input, and returns a string that defines the type of the input.

math.type
If the input is a number, it can output whether it's an integer or a float.