Skip to content

Types

string typeof ( any value )

Returns the name of the data type of value. Example:

typeof(1) # integer
typeof(/hi/) # regex
typeof(true) # boolean


int int ( any value )

Converts value into an integer.
If it fails, it returns zero.
If value is not a type that is convertable into an intger, it throws an error.


string str ( any target )

Returns a string representation of target, formatted the same way as print.


object obj ( array target )

Returns an object with key-value pairs drawn from child arrays in target.

Eg. [['a', 1], ['b', 2]] returns as {a: 1, b: 2}.


array arr ( enumarable target )

Returns an array containing the elements of target.
If the elements are multiple values, it wraps the values of each element in a sub-array.


int ascii ( char char )

Returns the ASCII code of the first character of char.


char char ( int code )

Returns the character with the ASCII code matching code.