The strRepeat() method constructs and returns a new string which contains the
specified number of copies of the string on which it was called, concatenated
together.
Throws
RangeError: repeat count must be non-negative.
Throws
RangeError: repeat count must be less than infinity and not overflow maximum string size.
strRepeat(value, count): string
Parameters
value: string
The value to be repeated
count: number
An integer between 0 and +Infinity, indicating the number of times to repeat the string.
Returns string
A new string containing the specified number of copies of the given string.
The
strRepeat()
method constructs and returns a new string which contains the specified number of copies of the string on which it was called, concatenated together.Throws
RangeError: repeat count must be non-negative.
Throws
RangeError: repeat count must be less than infinity and not overflow maximum string size.