repeat

最后更新于:2022-04-02 00:07:22

## repeat + [link](./repeat "Link to this entry.") + [source](https://github.com/lodash/lodash/blob/4.5.0正式版/lodash.src.js#L12413 "View in source.") + [npm](https://www.npmjs.com/package/lodash.repeat "See the npm package.") ``` _.repeat([string=''], [n=0]) ``` 重复 N 次字符串 ### 参数 1. [string=''] (string) 要重复的字符串 2. [n=0] (number) 重复的次数 ### 返回值 (string) 返回重复的字符串 ### 示例 ``` _.repeat('*', 3); // => '***' _.repeat('abc', 2); // => 'abcabc' _.repeat('abc', 0); // => '' ```
';