repeat() 返回一个新字符串,表示将原字符串重复n次。 早先通过join()实现了字符串连续复制,现在ES6中封装好了我们可以直接使用了~ "hello".repeat(2) // "hellohello"