JavaScript String.repeat() Method
The String repeat() method is a built-in JavaScript method that creates the new string by appending the particular number of copies of the reference string. Syntax of JavaScript string.repeat(): referenceString.repeat(count); Parameters count To generate the new string with total count copies Return It returns the new string without altering the reference string. Use the Decimal Parameter Value for string.repeat() Method The JavaScript string.repeat() method takes the positive value as a parameter to repeat the string a particular number of times.