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 2256f87 commit 0644d6fCopy full SHA for 0644d6f
Sprint-3/2-practice-tdd/repeat-str.js
@@ -2,6 +2,9 @@ function repeatStr(str, count) {
2
if (count < 0) {
3
throw new Error("Negative counts are not valid");
4
}
5
+ if (count === 0) {
6
+ return "";
7
+ }
8
let result = "";
9
for (let i = 0; i < count; i++) {
10
result += str;
0 commit comments