# ⚠ toArray()

## `Range.prototype.toArray()`

{% hint style="danger" %}
**Deprecated**: This feature is no longer recommended. Avoid using it, and update existing code if possible. Be aware that this feature may cease to work at any time.
{% endhint %}

The `toArray()` method returns a read-only array of the range in order minimum and maximum.

{% code title="range.class.ts" %}

```typescript
public toArray(): readonly [Min, Max] {
  return [this.#minimum.valueOf(), this.#maximum.valueOf()];
}
```

{% endcode %}

### Return type

#### Type

The **return type**&#x20;

### Returns

The **return value** is a read-only array of the range in order minimum and maximum.&#x20;

## Example usage

```typescript
// Example usage.
import { Range } from '@angular-package/range';

// Create new instance.
const range = new Range(4, 27);

// Returns [4, 27] of type readonly [4, 27]
range.toArray();
```


---

# Agent Instructions: 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:

```
GET https://docs.angular-package.dev/range-1/range/methods/toarray.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
