get name()

The `get` accessor obtains error name

RangeError.prototype.name

The get accessor obtains error name of a string type, set to 'RangeError' that is being thrown.

range-error.class.ts
public get name(): string {
  return 'RangeError';
}

Return type

Returns

The return value is the error instance name of string type.

Example usage

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

// Returns "RangeError".
new RangeError('problem', 'Fix accessor.').name;

Last updated