Range Error

Return to Glossary

The Range Error indicates an error when a value is not in the set or range of allowed values.

A Range Error is thrown when trying to pass a value as an argument to a function that does not allow a range that includes the value.

This can be encountered when:

passing a value that is not one of the allowed string values to String.prototype.normalize(), orwhen attempting to create an array of an illegal length with the Array constructor, orwhen passing bad values to the numeric methodsSource: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError