Skip to content

Commit 0f15af0

Browse files
committed
commit
1 parent 41c1401 commit 0f15af0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
function repeatStr() {
2-
return "hellohellohello";
1+
function repeatStr(str, count) {
2+
if (count < 0) {
3+
throw new Error("Count cannot be negative");
4+
}
5+
6+
return str.repeat(count);
37
}
48

59
module.exports = repeatStr;

0 commit comments

Comments
 (0)