Ad
  • Default User Avatar

    Not an issue~~

  • Default User Avatar

    That was done.

  • Custom User Avatar

    Seems like fixed

  • Default User Avatar

    I refuse to believe modifying prototypes is the way to go.
    I think it would be much better to simply write a sorting function.

  • Default User Avatar

    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, ...

  • Custom User Avatar

    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.

  • Custom User Avatar

    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.