> For the complete documentation index, see [llms.txt](https://katxupa.gitbook.io/katxupa/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://katxupa.gitbook.io/katxupa/get-a-taste-of-katxupa/dip-dive/range.md).

# Range

The Range class provides utility methods for working with numeric ranges. It allows you to generate a range of numbers, check if a value is within a specified range, and create aliases for the range methods.

<pre class="language-typescript" data-title="Example Usage"><code class="lang-typescript">rangeTo(0,10,3)
    .forEach(it => console.log(`Index: ${it}`));
// Output:
//    Index: 0
<strong>//    Index: 3
</strong>//    Index: 6
//    Index: 9
</code></pre>

## Functions

### rangeTo

Creates an array representing a range of numbers from start to end (inclusive) with an optional step.

```typescript
const numericRange = rangeTo(1, 5, 2);
console.log(numericRange); // Output: [1, 3, 5]
```

### rangeUntil

Creates an array representing a range of numbers from start to (end - 1) with an optional step.

```typescript
const numericRange = rangeUntil(1, 5, 2);
console.log(numericRange); // Output: [1, 3]
```

### inRange

Checks if a value is within the specified numeric range.

```typescript
const isInRange = inRange(3, 1, 5);
console.log(isInRange); // Output: true
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://katxupa.gitbook.io/katxupa/get-a-taste-of-katxupa/dip-dive/range.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
