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.
I really like this solution as it is really simple to read and understand.
Arguments are only mutated if you mutate it like you mutate objects. Reassigning values is like calling a different thing the same name, it does not mutate anything so it's perfectly fine.
Unless you're intentionally using optional arguments as replacement of
var
, in which case that would actually make things less readable ;-)I am fully aware of this technical aspect. But doesn't this procedure break a readabilty? I am a comming from a assumption that argument is 'immutable' inside a method, and if we want to acces anything from it, just create a specific variable or access it directly.
Just my thoughts
It doesn't change any references. You're thinking of something else which only happens with languages with explicit pointers (e.g C and C++).
This comment is hidden because it contains spoiler information about the solution