@newdash/newdash
Version:
javascript/typescript utility library
24 lines (23 loc) • 458 B
TypeScript
/**
* Repeats the given string `n` times.
*
* @since 5.7.0
* @category String
* @param str The string to repeat.
* @param n The number of times to repeat the string.
* @returns Returns the repeated string.
* @example
*
* ```js
* repeat('*', 3)
* // => '***'
*
* repeat('abc', 2)
* // => 'abcabc'
*
* repeat('abc', 0)
* // => ''
* ```
*/
export declare function repeat(str: string, n?: number, guard?: any): string;
export default repeat;