odin-javascript-exercises/repeatString/repeatString.js

11 lines
227 B
JavaScript
Raw Normal View History

2017-11-20 11:51:01 -08: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 08:28:29 -07:00
}
module.exports = repeatString