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.

RangeError: repeat count must be non-negative.

RangeError: repeat count must be less than infinity and not overflow maximum string size.

  • 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.