Exercise complete

This commit is contained in:
billalp 2019-11-04 22:07:31 +00:00
parent 04e21d84d9
commit 5d2e7b2c34
1 changed files with 7 additions and 4 deletions

View File

@ -1,10 +1,13 @@
const repeatString = function(word, times) {
let arr = [];
if (times < 0) {
return 'ERROR';
} else {
for (let i = 0; i < times; i++) {
arr.push(word);
}
}
return arr.join('');
}