js代码技巧积累(一)

88 阅读1分钟

生成指定长度的、指定内容构成的字符串:

const generateStr = (length: number, str: string) => Array(length).fill(str).join("");