Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "string/repeat/docs/types/index.d"

Index

Functions

Functions

Export assignment repeat

  • repeat(str: string, n: number): string
  • Repeats a string n times and returns the concatenated result.

    Parameters

    • str: string

      string to repeat

    • n: number

      number of times to repeat the string

    Returns string

    repeated string

    Example

    var str = repeat( 'a', 5 );
    // returns 'aaaaa'

    Example

    var str = repeat( '', 100 );
    // returns ''

    Example

    var str = repeat( 'beep', 0 );
    // returns ''