Manchester | 26-ITP-May | Joanne O’Malley | Sprint 3 | Practice TDD#1353
Manchester | 26-ITP-May | Joanne O’Malley | Sprint 3 | Practice TDD#1353joanne342 wants to merge 13 commits into
Conversation
LonMcGregor
left a comment
There was a problem hiding this comment.
Good work on the first two tasks, you need to re-attempt the repeat task however
| // 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). | ||
| // The goal is to re-implement that function, not to use it. | ||
| return "hellohellohello"; | ||
| return str.repeat(count); |
There was a problem hiding this comment.
Did you read the comment in this task? The goal is to implement without using the repeat method. Can you try again?
There was a problem hiding this comment.
Yes, Sorry, I overlooked it. I've changed it to
return Array.from({ length: count }, () => str).join("");
LonMcGregor
left a comment
There was a problem hiding this comment.
Almost done, still some changes needed though
| // 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). | ||
| // The goal is to re-implement that function, not to use it. | ||
| return str.repeat(count); | ||
| return Array.from({ length: count }, () => str).join(""); |
There was a problem hiding this comment.
This is an interesting approach. I can see what you are going for. Have you tried testing this function as it is written? There might be something still missing.
There was a problem hiding this comment.
I didn't test it because I'm on my work laptop and I'm not allowed to install anything but I made a codespace and tested it now and added a conditional in case of a negative count.
LonMcGregor
left a comment
There was a problem hiding this comment.
Great work! always a good idea to fully test before submitting a PR. this task is complete now
Learners, PR Template
Self checklist
Changelist
Sprint 3 | Practice TDD