Value Types
Lua variables can contain one type of *value.*
Data Type | Description | Example |
|---|---|---|
nil | A value with no data (null not 0). A variable without an assigned value is nil by default. | local x |
boolean | Either true or false. | local x = true |
number | Any number, including fractional or negative numbers. | local x = 103.9 |
string | A string of text or characters. See Strings | local x = "This is a string" |
table | See Lua Tables. | local x = 4 |
function | See function. | function hello() |
userdata | See User data type |
In the Translator, you can use type() to see the variable value:
local name = Tracy
type(name) -- will display string