Skip to content

Commit e56c42c

Browse files
committed
repeatStr function code completed
1 parent e4845c4 commit e56c42c

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+
return str.repeat(count);
4+
} else {
5+
throw new Error("");
6+
}
37
}
48

59
module.exports = repeatStr;

0 commit comments

Comments
 (0)