Skip to content
JS
JavaScript error

RangeError

The JavaScript exception "repeat count must be less than infinity" occurs when the String.prototype.repeat() method is used with a count argument that is infinity.

Reference entryJavaScriptFetched
RangeError: Invalid string length (V8-based)
As listed by MDN Web Docs
RangeError: Invalid count value: Infinity (V8-based)
As listed by MDN Web Docs
RangeError: repeat count must be less than infinity and not overflow maximum string size (Firefox)
As listed by MDN Web Docs
RangeError: Out of memory (Safari)
As listed by MDN Web Docs
RangeError: String.prototype.repeat argument must be greater than or equal to 0 and not be Infinity (Safari)
As listed by MDN Web Docs
Category
RangeError
Severity
error
Runtime
both
or press Cmd/Ctrl + Enter. The text is only sent to this site to match it.
Source: MDN Web Docs. Data fetched 2026-09-25T01:48:37.274Z.