The function throwRangeError throws a RangeError with a custom message if called.
throwRangeError(message?): void
Parameters
Optionalmessage: string = 'The value is off-limits.'
The message parameter is a string that represents the
error message to be displayed when a RangeError is thrown. If no message is provided, the default
message is 'The value is off-limits.'.
The function
throwRangeErrorthrows a RangeError with a custom message if called.