Skip to content

Commit c8c9bc1

Browse files
committed
function Updated
1 parent 2614707 commit c8c9bc1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Sprint-3/2-practice-tdd/repeat.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
function repeat() {
2-
return "hellohellohello";
1+
function repeat(word, times) {
2+
if (times < 0) {
3+
throw new Error("Count must be a non-negative number");
4+
}
5+
return word.repeat(times);
36
}
47

58
module.exports = repeat;

0 commit comments

Comments
 (0)