Skip to content

Commit 00f4fb9

Browse files
I wrote different test cases to handel repeating string for times more than 1, and to give empty out put for (0)
and 'invalid count' output for negative counts.
1 parent df1e7bd commit 00f4fb9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
function repeatStr() {
2-
return "hellohellohello";
3-
}
1+
function repeatStr(str, count) {
2+
if( count >= 0 )
3+
{return str.repeat (count)};
4+
else { return 'invalid count'};
5+
};
46

57
module.exports = repeatStr;

0 commit comments

Comments
 (0)