repeat
Method returns a new string that represents the original string is repeated n
twice.
"abc".repeat(-1) // RangeError: repeat count must be positive and less than inifinity "abc".repeat(0) // "" "abc".repeat(1) // "abc" "abc".repeat(2) // "abcabc" "abc".repeat(3.5) // "abcabcabc" 参数count将会被自动转换成整数. "abc".repeat(1/0) // RangeError: repeat count must be positive and less than inifinity