3 ms·
Hey! you are the one from the blog comment :) It must be pretty fun to create those curriculums!! I agree with you that the restriction of not using loops can
by helloiloveyou 7y ago
Hey! you are the one from the blog comment :) It must be pretty fun to create those curriculums!!
I agree with you that the restriction of not using loops can also direct you to apply recursion.
However do you believe recursion makes it easier to debug certain parts of the array when you can adjust the starting and stoping points in the guard of the for loop?
- yjhoney 7y agoUltimately, everyone should use higher order functions. In your case (as other commenters have said), map or forEach should have been used. I don't really want to make a statement that recursion makes debugging easier because I don't code like that at work. I use utility functions (map, reduce, filter, etc.)