JavaScript · Error types

RangeError

Signals a value outside the allowed range, such as an invalid array length.

Syntax
new RangeError(message)

Example

Try it

More in this group

AggregateError error.stack new Error() SyntaxError TypeError

Learn this in the course

Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.

Open the course