@bnidev/js-utils
    Preparing search index...

    Function repeat

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

      Returns string

      The repeated string.

      // ES Module
      import { repeat } from '@bnidev/js-utils'

      // CommonJS
      const { repeat } = require('@bnidev/js-utils')
      repeat('abc', 3) // 'abcabcabc'
      repeat('x', 5) // 'xxxxx'