feat(totalIntegers): create exercise - #443
Conversation
mao-sz
left a comment
There was a problem hiding this comment.
General but important comment to consider for this one - I'll let you have a think about how you want to approach this.
- No need to reinvent the wheel for isInteger
- You only test nested arrays but what if there are objects within the array(s) that contain integer values?
e.g.
[4, 6, { a: 1, b: { a: 10, b: 11 } }, 9]
Didn't know that method exists, how convenient! Good point about the objects with numbers, that certainly makes the challenge more interesting |
|
Wait whaaaat xD |
mao-sz
left a comment
There was a problem hiding this comment.
Haven't had time to assess the tests but at least in terms of how the solution is written, here are some suggestions.
Co-authored-by: MaoShizhong <122839503+MaoShizhong@users.noreply.github.com>
Co-authored-by: MaoShizhong <122839503+MaoShizhong@users.noreply.github.com>
Co-authored-by: MaoShizhong <122839503+MaoShizhong@users.noreply.github.com>
mao-sz
left a comment
There was a problem hiding this comment.
2 more general comments:
- Don't forget to add
.skipto all but the 1st test in the suite. - I know the earlier exercises use a traditional function expression but I think it may be sensible to have these new exercises use arrow functions, and also for the non-solution template. The older exercises can always be updated another time. @JoshDevHub, thoughts on having the exercises use arrow functions instead of traditional func expressions?
For the first point, I am pretty sure that the Also I agree that it would be nice to have them all be arrow functions however I think consistency is important and it would be better to update them in a different PR. Also considering that the exercise generator tool would need to be updated too it would certainly have to all be in a separate PR. |
|
Ah yes, the solution test suite doesn't. As long as the skips get added when you copy over for the non-solution test suite, then all is good 👍 Also fair point on the exercise generator tool - let's stick to trad. function expressions then. |
JoshDevHub
left a comment
There was a problem hiding this comment.
Left some thoughts. Let me know if you have any questions.
|
@nikitarevenco Any issues with the above comments from Josh? |
… of the function was not being passed to any function calls
Co-authored-by: Josh Smith <jmsmith1018@gmail.com>
Ok, went over all the comments just now and added the suggestions |
mao-sz
left a comment
There was a problem hiding this comment.
After the comment below, I'm happy to approve once the tests and appropriate skips have been copied over to the other spec file 🔥
JoshDevHub
left a comment
There was a problem hiding this comment.
Other than Mao's one live comment, I think everything looks good with this.
feat(totalIntegers): create exercise
feat(totalIntegers): create exercise
Because
It was decided to add new recursion exercises
Previous
This PR
Issue
Related to #27265
Additional Information
Pull Request Requirements
location of change: brief description of changeformat, e.g.01_helloWorld: Update test casesBecausesection summarizes the reason for this PRThis PRsection has a bullet point list describing the changes in this PRIssuesection/solutionsfolder