Conversation
LonMcGregor
left a comment
There was a problem hiding this comment.
Good start, but there are still some things to work on
LonMcGregor
left a comment
There was a problem hiding this comment.
Using recursion is a good approach for this. Task complete
|
Closing PR because the May ITP run has finished. Feel free to re-open if you're still working on it. |
iscmiguelsamaniego
left a comment
There was a problem hiding this comment.
Fantastic and clean solution for countChar! Using array methods makes the logic concise and readable. Even without comments, your code is clear and well-structured. Great work—approved!
There was a problem hiding this comment.
This is a wonderfully clean and expressive solution! Using array methods like .split() and .filter() makes the logic very readable and easy to follow.
Quick question: while this functional approach is great for readability, what happens if you pass a very large string? Can you think of an alternative way to count characters (like using a loop or for...of) that avoids creating an intermediate array?
There was a problem hiding this comment.
Fantastic test suite! Using Jest (test, expect) and covering clear scenarios like multiple occurrences and zero matches makes the code very robust. Great job
There was a problem hiding this comment.
Fantastic implementation! Handling the special cases for 11, 12, and 13 along with robust input validation makes this code exceptionally reliable.
There was a problem hiding this comment.
Fantastic test suite! Grouping tests into meaningful categories (such as special endings, edge cases, negative numbers, and non-number inputs) provides exceptional test coverage. Great work
There was a problem hiding this comment.
Fantastic recursive implementation! Avoiding String.prototype.repeat and using recursion to build the string while properly handling validation and edge cases is brilliant.
There was a problem hiding this comment.
Fantastic test suite! Covering multiple repetitions, edge cases like 0 and 1, and negative input error handling ensures robust test coverage.
Learners, PR Template
Self checklist
Changelist
Add tests and functions for these problems:
count.test.jsrepeat-str.test.jsget-ordinal-number.test.js