Int
Library of functions for the int type.
Functions
From
Builds an int from a number or string.
Syntax:
Int.From(value: number or string)
Parameters
value
: The value to convert to int.
Returns
int
: The int representation of the value.
Example:
Int.From("123")
// Result:
// 123
Int.From(1.5)
// Result:
// 1
Range
Builds a collection of integers between two specified values.
Syntax:
Int.Range(start: int, end: int, step: optional int)
Parameters
-
start
: The starting value. -
end
: The end value (not included). -
step
: The step value (default: 1).
Returns
collection(int)
: The collection of integers between start and end (not included) with the given step interval.
Example:
Int.Range(0, 10, step=2)
// Result:
// [0, 2, 4, 6, 8]