JS Utils Kit - v0.5.1
    Preparing search index...

    Function repeatString

    • Repeats a string a specified number of times.

      Parameters

      • str: string

        The string to repeat.

      • count: number

        The number of times to repeat the string (must be non-negative).

      Returns string

      The string repeated the specified number of times.

      console.log(repeatString("hi", 3)); // "hihihi"
      console.log(repeatString("a", 2)); // "aa"
      console.log(repeatString("test", 0)); // ""
      console.log(repeatString("", 5)); // ""