Type
Name
Values
Null
null
Boolean
bool
true false
true
false
Number
num
123 3.14 0b10 0x1ab
123
3.14
0b10
0x1ab
String
str
"hello" 'hi world'
"hello"
'hi world'
Pointer
ptr
See Pointers
// todo
Array
arr
[] [1, 2, 3] ['a', 'b']
[]
[1, 2, 3]
['a', 'b']
Map
map
{} { a: 4, b: 'hi' }
{}
{ a: 4, b: 'hi' }
Array and map are special types to store multiple values.
To get type of a value, just use the keyword typeof.
typeof is an unary operator, so you need group your value in many cases.
Last updated 4 years ago
puts typeof 1 // num puts typeof 'Hi' // str
puts typeof (4 + 5) // num