range

utility

Generates a number sequence

Syntax

range(start, end, step?)

Parameters

start (number)

Starting value

end (number)

Ending value (inclusive)

step (number) optional

Step size (default 1)

Returns

array

Array of numbers from start to end

Examples

Generate sequence from 1 to 10
Input:
range(1, 10)
Output:
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
Generate sequence with step of 10
Input:
range(0, 100, 10)
Output:
[0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100]
Generate rows with IDs
Input:
range(1, 5) | map({id: .})
Output:
[{id: 1}, {id: 2}, {id: 3}, {id: 4}, {id: 5}]

The range() function generates a sequence of numbers from a start value to an end value with an optional step size.

Usage

Use range() to generate numeric sequences, create test data, or produce ID ranges for data generation.