Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This approach is not good. It changes the parameter if it has a falsy value, for example if an empty string were passed to firstName or lastName, it would be changed to the default value, which is incorrect. The correct way is to use default parameters.
I don't think I was aware of the default parameter feature when I solved this. If I were to solve it again I would use default parameters.
What's the benefits of this approach over the top solution?
ie. assigning fields directly inside body vs. exposing them as default paramters.
Thanks but the idea is to learn recursion, redability > performance when the loose is incinificant.
This comment is hidden because it contains spoiler information about the solution