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.
Not an issue~~
That was done.
Seems like fixed
I refuse to believe modifying prototypes is the way to go.
I think it would be much better to simply write a sorting function.
I agree that for production code it is better to put curly braces around
for
blocks. Any linter would point that out.But on CodeWars people seem to favor more concise solutions, that's why you will see lots of one-liner.
For this one, I think it is still readable as is, not being overly complex: no comma operator, one instruction per
for
block, only four lines.Of course it is not the best but I find it acceptable.
Also, note that "best practice" does not represent only readability. People can vote because of many things independant of code style: algorithm, elegant way of solving the issue, performance, ...
In case you haven't worked this out yet, [null] means an array with a null object inside it, whereas null means a null object. S0 you just want to change your code so it returns null if any of the elements are null.
Hey @wesley It is meant to be like that - to let the users study the pattern and solve the kata.
And when I started off this Complete The Pattern Series, I used to give algerbraic version of the pattern (sort of) to understand the pattern but as suggested by wthit56 it ended up as a big confusion so I dropped that idea for futher katas.
And I personaly think it is much easier and convinient for the users to understand the kata challenge from the examples.