打开 微信扫一扫登录
repeat()方法用于指定重复指定字符串的次数。
语法:
str.repeat(count)
参数:
● count - 字符串应重复的次数。
返回值:
返回一个新字符串。
例:
var myBook = new String("Perl"); console.log(myBook.repeat(2));
输出:
PerlPerl
推荐手册