> For the complete documentation index, see [llms.txt](https://docs.angular-package.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.angular-package.dev/range-1/range/methods/toarray.md).

# ⚠ 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();
```
