There was an error while loading. Please reload this page.
1 parent f4e8bed commit fa3354aCopy full SHA for fa3354a
1 file changed
Sprint-3/2-practice-tdd/repeat-str.js
@@ -1,4 +1,8 @@
1
function repeatStr(str, count) {
2
+ if (count < 0) {
3
+ throw new Error("Count cannot be negative");
4
+ }
5
+
6
let result = "";
7
8
for (let i = 0; i < count; i++) {
0 commit comments