repeat()返回一个新字符串,表示将原字符串重复n次。var str = "x"; str.repeat(3) // "xxx" var str1 = "hello"; str1.repeat(2) // "hellohello"