range

To return an array of consecutive numbers

With this function, you can define a numeric value range with a from-to specification. Where from might be set automatically to 0 if there is only one parameter.

The from value is included and the to value is excluded.

Syntax

range(number)

range(number, number)

range(number, number, number)

Return

[number]

Examples

range(to) To return an array of consecutive numbers starting with 0 up or down to to, where to is excluded.

concat(range(7))

Result: 0, 1, 2, 3, 4, 5, 6

range(from, to) To return an array of consecutive numbers from a range between from and to, where from is included and to is excluded. If from is higher than to the numbers will appear in reverse order.

range(2,7)

Result: [2, 3, 4, 5, 6]

range(from, to, step) To return an array of consecutive numbers from a range between from and to by a given step, where from is included and to is excluded. If from is higher than to the numbers will appear in reverse order.

range(2, 9, 2)

Result: [2, 4, 6, 8]

See also

concat, which returns all items of an array in one string.

Last updated