2017-11-20 19:51:01 +00:00
|
|
|
var repeatString = function(string, num) {
|
|
|
|
if (num < 0) return 'ERROR'
|
|
|
|
let returnValue = ''
|
|
|
|
for(let i = 0; i < num; i++) {
|
|
|
|
returnValue = returnValue + string
|
|
|
|
}
|
|
|
|
return returnValue
|
2017-08-21 15:28:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = repeatString
|