Passed test 1

This commit is contained in:
Mohammed Nabeel 2020-07-16 08:54:02 +03:00
parent 0f2c4f68b2
commit 2a41f84c1a
1 changed files with 15 additions and 2 deletions

View File

@ -1,5 +1,18 @@
const repeatString = function() { const repeatString = function(string, number) {
let result = '';
for (let i = 0; i < number; i++) {
if (number < 0) {
return 'ERROR';
} else {
result += string;
}
}
return result;
} }
module.exports = repeatString module.exports = repeatString