YouTip LogoYouTip

Jsref Repeat

# JavaScript String repeat() Method [![Image 3: String Object Reference Manual](#) JavaScript String Object](#) ## Example Copy the string "" twice: var str = ""; str.repeat(2); _n_ Output: TutorialTutorial [Try it Β»](#) * * * ## Definition and Usage The repeat() method repeats a string a specified number of times. * * * ## Browser Support The numbers in the table specify the first browser version that fully supports the property. | Method | | | | | | | --- | --- | --- | --- | --- | --- | | repeat() | 41 | 12.0 | 24.0 | 9 | 28 | * * * ## Syntax string.repeat(count) ## Parameter Values | Parameter | Description | | --- | --- | | _count_ | Required. The number of times to repeat the string. | ## Return Value | Type | Description | | --- | --- | | String | A new string containing the specified number of copies of the original string, concatenated together. | ## Technical Details | JavaScript Version: | ECMAScript 6 | | --- | * * JavaScript String Object](#)
← Jsref TrimTs Ambient β†’