Skip to content

Commit 87433e4

Browse files
committed
Found solution for the first test in Sprint-3/2-practice-tdd/repeat.test.js
1 parent 64794e8 commit 87433e4

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1-
function repeat() {
2-
return "hellohellohello";
1+
function repeat(str, count) {
2+
let repeatedStrCountTimes = "";
3+
4+
let i = 0;
5+
while (i < count) {
6+
repeatedStrCountTimes += str;
7+
i++;
8+
}
9+
return repeatedStrCountTimes;
310
}
411

512
module.exports = repeat;

0 commit comments

Comments
 (0)