types

Contains functions for type checking and conversion

Constants

OBJECT : number = 0

NUMBER : number = 1

STRING : number = 2

ARRAY : number = 3

MAP : number = 4

FUNCTION : number = 5

Functions

byte(value) - converts value to byte

double(value) - converts value to double

float(value) - converts value to float

int(value) - converts value to int

long(value) - converts value to long

number(value) - converts value to number if possible

Example

print typeof(number("2.3")) // 1 (NUMBER)

short(value) - converts value to short

string(value) - converts value to string

Example

print typeof(string(1)) // 2 (STRING)

typeof(value) - returns the type of value

Example

print typeof(1) // 1 (NUMBER)
print typeof("text") // 2 (STRING)
print typeof([]) // 3 (ARRAY)

results matching ""

    No results matching ""