# get range()

## ​`RangeError.prototype.range`

The [`get`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get) accessor obtains the [minimum](https://docs.angular-package.dev/error/rangeerror/accessors/get-min) and [maximum](https://docs.angular-package.dev/error/rangeerror/accessors/get-max) 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>](https://docs.angular-package.dev/error/generic-type-variables#rangeerror-less-than-id-min-max-greater-than-1)`; max?:`[<mark style="color:green;">`Max`</mark>](https://docs.angular-package.dev/error/generic-type-variables#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](https://docs.angular-package.dev/error/rangeerror/accessors/get-min) range under the `min` property and the [maximum](https://docs.angular-package.dev/error/rangeerror/accessors/get-max) under the `max` property.

`min` - The minimum range of generic type variable [`Min`](https://docs.angular-package.dev/error/generic-type-variables#rangeerror-less-than-id-min-max-greater-than-1) of the [`RangeError`](https://docs.angular-package.dev/error/rangeerror) instance.\
`max` - The maximum range of generic type variable [`Max`](https://docs.angular-package.dev/error/generic-type-variables#rangeerror-less-than-id-min-max-greater-than-2) of the [`RangeError`](https://docs.angular-package.dev/error/rangeerror) 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;
```
