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