Skip to content

Commit 866a426

Browse files
reedited the function.
1 parent 5d0e895 commit 866a426

File tree

1 file changed

+4
-3
lines changed

1 file changed

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

67
module.exports = repeatStr;

0 commit comments

Comments
 (0)