Skip to content

Commit e38f3b2

Browse files
authored
Add repeatStr function implementation
Implemented repeatStr function without using String.prototype.repeat.
1 parent c1996f9 commit e38f3b2

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
function repeatStr() {
22
// Your implementation of this function must *not* call String.prototype.repeat (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat).
33
// The goal is to re-implement that function, not to use it.
4-
4+
let result = "";
5+
56
for (let i = 0; i < count; i++) {
67
result += str;
78
}

0 commit comments

Comments
 (0)