# get max()

## `RangeError.prototype.max`

The [`get`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get) accessor obtains the maximum range of generic type variable [`Max`](https://error.angular-package.dev/draft-5/generic-type-variables#rangeerror-less-than-id-min-max-greater-than-2) that causes an error to be thrown(or not thrown), if set, otherwise returns [`undefined`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined).

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

```typescript
public get max(): Max | undefined {
  return this.#max;
}
```

{% endcode %}

### Return type

#### [<mark style="color:green;">`Max`</mark>](https://error.angular-package.dev/draft-5/generic-type-variables#rangeerror-less-than-id-min-max-greater-than-2)`|`[<mark style="color:green;">`undefined`</mark>](https://www.typescriptlang.org/docs/handbook/basic-types.html#null-and-undefined)

### Returns

The **return value** is the maximum range of generic type variable [`Max`](https://error.angular-package.dev/draft-5/generic-type-variables#rangeerror-less-than-id-min-max-greater-than-2) or [`undefined`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined).

## Example usage

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

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