mirror of
https://github.com/10h30/odin-javascript-exercises.git
synced 2026-06-05 15:09:09 +09:00
11 lines
227 B
JavaScript
11 lines
227 B
JavaScript
var repeatString = function(string, num) {
|
|
if (num < 0) return 'ERROR'
|
|
let returnValue = ''
|
|
for(let i = 0; i < num; i++) {
|
|
returnValue = returnValue + string
|
|
}
|
|
return returnValue
|
|
}
|
|
|
|
module.exports = repeatString
|