Skip to main content

repeatEveryChars

Callable

  • repeatEveryChars(str: string, repeats: number): string

  • Repeats every other character in the given string a specified number of times.

    @example
    repeatEveryChars('abc', 2) // 'aabbcc'

    Parameters

    • str: string

      The input string to repeat characters from.

    • repeats: number

      The number of times to repeat each character.

    Returns string

    The modified string with every other character repeated.