# get range()

## ​`RangeError.prototype.range`

The [`get`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get) accessor obtains the [minimum](/error/rangeerror/accessors/get-min.md) and [maximum](/error/rangeerror/accessors/get-max.md) range in the form of an [object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object).

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

```typescript
public get range(): { min?: Min; max?: Max } {
  return {
    min: this.#min,
    max: this.#max,
  };
}
```

{% endcode %}

### Return type

#### `{ min?:`[<mark style="color:green;">`Min`</mark>](/error/rangeerror/generic-type-variables.md#rangeerror-less-than-id-min-max-greater-than-1)`; max?:`[<mark style="color:green;">`Max`</mark>](/error/rangeerror/generic-type-variables.md#rangeerror-less-than-id-min-max-greater-than-2)`}`

The **return type** is the [`object`](https://www.typescriptlang.org/docs/handbook/basic-types.html#object) that consists of the `min` and `max` properties, indicating the error range.

### Returns

The **return value** is an [`object`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) that consists of the [minimum](/error/rangeerror/accessors/get-min.md) range under the `min` property and the [maximum](/error/rangeerror/accessors/get-max.md) under the `max` property.

`min` - The minimum range of generic type variable [`Min`](/error/rangeerror/generic-type-variables.md#rangeerror-less-than-id-min-max-greater-than-1) of the [`RangeError`](/error/rangeerror/overview.md) instance.\
`max` - The maximum range of generic type variable [`Max`](/error/rangeerror/generic-type-variables.md#rangeerror-less-than-id-min-max-greater-than-2) of the [`RangeError`](/error/rangeerror/overview.md) instance.

## Example usage

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

// Returns "{min: 9, max: 27}".
new RangeError('problem', 'Fix accessor.', '(AE:427)', 9, 27).range;
```


---

# 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/error/rangeerror/accessors/get-range.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.
