get range()

The `get` accessor obtains the range of minimum and maximum

RangeError.prototype.range

The get accessor obtains the minimum and maximum range in the form of an object.

range-error.class.ts
public get range(): { min?: Min; max?: Max } {
  return {
    min: this.#min,
    max: this.#max,
  };
}

Return type

{ min?:Min; max?:Max}

The return type is the object that consists of the min and max properties, indicating the error range.

Returns

The return value is an object that consists of the minimum range under the min property and the maximum under the max property.

min - The minimum range of generic type variable Min of the RangeError instance. max - The maximum range of generic type variable Max of the RangeError instance.

Example usage

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

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

Last updated