Returns a new string object with a value equal to the original string repeated the specified number of times.
Syntax
stringObj.repeat(count);
Parameters
stringObj
Required. The string object.
count
Required. The number of times to repeat the original string in the returned string.
Exceptions
This method throws a RangeError if and only if the argument is negative or +Infinity.
Remarks
The repeat method concatenates the original string to the new string the number of times specified by count.
This method throws an error if count is not a positive number less than Infinity.
Example
"abc".repeat(3); // Returns "abcabcabc"
"abc".repeat(0); // Returns an empty string.
Requirements
Supported in Microsoft Edge (Edge browser). Also supported in Store apps (Microsoft Edge on Windows 10). See Version Information.
Not supported in the following document modes: Quirks, Internet Explorer 6 standards, Internet Explorer 7 standards, Internet Explorer 8 standards, Internet Explorer 9 standards, Internet Explorer 10 standards, Internet Explorer 11 standards. Not supported in Windows 8.1.

