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 comment is hidden because it contains spoiler information about the solution
WERY GOOD!!!
nice one!
This comment is hidden because it contains spoiler information about the solution
Interesting
I understand that, but indexing the string values would't be a string values aswell? I mean you need numbers to use the operands in this function, or at least I though that.
This comment is hidden because it contains spoiler information about the solution
I'm trying to understand this, so inside the .map function you can declare a variable (in this case "game", but it could be called anything right?) that refers to one element of the array?
Overriding the prototype is definitely not a good practice.
But other than that, this code is simple and that is a good thing.
Sure, it won't be optimal for running anagramm checks for millions of items, but that was not a requirement. Usually if something has to handle big data you know either because it is obvious from the context, or you are told that.
In this case premature optimization would only made the code more complex and thus harder to read and understand. And that can be bad.
The speed of sort is irrelevant for an array of a couple of items and only a handful of invocations. Readability and maintainability is way more important for such cases.
I literally did the same, just because I could. But this is bad. First it's goes N 3 times also sort! and ther are rumors for messing with prototype is no good.
Thanks for this clever solution
sorting a word on every iteration consume extra cpu, rather you can sort word once and use it in filter
sort is very slow. Definitely not a best practice
Nice
Loading more items...