Standard built-ins

RangeError()

Try the free JavaScript compiler

Indicates an out-of-range value, such as an invalid array length. Creating it does not throw automatically.

Formal Syntax & Structure

javascript syntaxjavascript
new RangeError([message], [options])

Parameters & Attributes

NameTypeDescription
messageStringDiagnostic text.
optionsObjectOptional cause property.

Return Value

RangeError

Error subtype instance.

Working Example

Example Snippetjavascript
console.log(new RangeError("example").name);
JavaScript Reference