repeatCopy.js 299 B

12345678910111213141516
  1. /**
  2. *
  3. * @desc 字符串重复复制
  4. * @param {String} str
  5. * @param {Number} count:复制次数
  6. * @return {String}
  7. */
  8. function repeatCopy(str, count) {
  9. var text = '';
  10. for (var i = 0; i < count; i++) {
  11. text += str;
  12. };
  13. return text;
  14. };
  15. module.exports = repeatCopy;