Skip to content

Commit dc6234d

Browse files
authored
Update repeat-str.js
1 parent 45af671 commit dc6234d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Sprint-3/2-practice-tdd/repeat-str.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ function repeatStr() {
44
if (count === 1) {
55
return str;
66

7-
} else if (count < 1) {
7+
} else if (count < 0) {
88
throw new Error("Something went wrong");
99

10+
} else if (count === 0) {
11+
return "";
12+
1013
} else {
1114
return Array.from({ length: count }, () => str).join("");
1215
}

0 commit comments

Comments
 (0)