js字符串repeat
Introduced in ES2015, repeats the strings for the specificed number of times:
'Ho'.repeat(3) //'HoHoHo'
Returns an empty string if there is no parameter, or the parameter is 0
. If the parameter is negative you’ll get a RangeError.
如果没有参数,或者参数为0
,则返回一个空字符串。 如果参数为负,则将显示RangeError。
js字符串repeat