Skip to content

Commit e21abf0

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 1dbf4e3 commit e21abf0

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed
Lines changed: 6 additions & 4 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

5-
module.exports = repeatStr;
7+
module.exports = repeatStr;

0 commit comments

Comments
 (0)