We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 602f4d6 commit 1d5374dCopy full SHA for 1d5374d
1 file changed
Sprint-3/2-practice-tdd/repeat-str.js
@@ -4,7 +4,7 @@ function repeatStr(stringOfCharacters, count) {
4
if (count === 0) {
5
return "";
6
} else if (count > 0) {
7
- return stringOfCharacters.repeat(count);
+ return repeatStr(stringOfCharacters, count - 1) + stringOfCharacters;
8
}
9
throw Error("Invalid input: count must be a non-negative integer");
10
0 commit comments