NewDash

    Function repeat

    • Repeats the given string n times.

      Parameters

      • str: string

        The string to repeat.

      • n: number = 1

        The number of times to repeat the string.

      • Optionalguard: any

      Returns string

      Returns the repeated string.

      5.7.0

      repeat('*', 3)
      // => '***'

      repeat('abc', 2)
      // => 'abcabc'

      repeat('abc', 0)
      // => ''
    MMNEPVFCICPMFPCPTTAAATR