Tweakr
    Preparing search index...

    Function repeat

    • Repeats a string a specified number of times.

      Parameters

      • str: string

        The string to repeat.

      • times: number

        Number of times to repeat the string. Must be a non-negative integer.

      Returns string

      The concatenated string repeated times times.

      1.1.0

      repeat("abc", 3); // "abcabcabc"
      repeat("!", 5); // "!!!!!"
      repeat("hi", 0); // ""