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 like this solution! :D like mine... but mine definetly uglier
btw, how do you colaberate with other people?
oh.
It emphasizes the algorithmic side of a problem.
but then i wonder, why would a code that causes recursion be considered good(clever, and best practice)? In a part of a book i read, it condemns code like this.
For really long strings it would. Also, all those
slice
s would be slow for long strings.The mechanics of this code is genious! but would not this cause stack overflow ?? pls elaborate thx
thanks for explaining~ you're awesome<3
This comment is hidden because it contains spoiler information about the solution
Arrays are objects, too, hence why it works. In general though, best practices are to use arrays only for consecutive numeric keys. This is because browsers can optimize for that scenario (e.g. using a real C++ array).
If you're thinking of associative arrays, javascript's closest equivalent is the object. However, objects differ in implementation from pure maps, so when Ecmascript 6 comes along, we should probably start using Map for these things.