2021-05-09 12:06:18 +00:00
|
|
|
const repeatString = function(word, times) {
|
2021-04-30 10:12:52 +00:00
|
|
|
if (times < 0) return 'ERROR'
|
|
|
|
let string = ''
|
|
|
|
for (let i = 0; i < times; i++) {
|
|
|
|
string += word
|
|
|
|
}
|
|
|
|
return string
|
2017-08-21 15:28:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = repeatString
|