Ad
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    SatanKid don't look at the exact numbers but at the difference between tests. You'll see that one test case consistently outperforms the other. The difference in speed per run is due to processing power being available and such.

  • Default User Avatar

    The main problem here is that Codewars does not indicate which JavaScript version the katas and solutions target.

    There is also no indication how old this kata and the solutions are, in fact they are from a time when fat arrows and other modern constructs were not yet available in JavaScript.

    Another problem is that there is no indication whether the solution should be optimized for speed or for readability.

    If the lists are very small and the function is not used frequently, a simple and readable solution might be preferred over an optimized and faster one.

  • Custom User Avatar

    I don't get it, if generally is ok, but in one of the languages the convention is different, why the kata should be renamed affecting all languages? I'd have probably used PascalCase from the beginning, but changing the name of the kata and the function's name in every language isn't free. You need to make all tests backward compatible to not render all solutions invalid.

  • Custom User Avatar
  • Custom User Avatar

    Generally speaking, camel case can refer to both upper CamelCase and lower camelCase. However, in the JavaScript ecosystem the convention is to use camelCase as the naming for the lowercase version and PascalCase for the uppercase version. Therefor, this Kata should be renamed.

    For reference, you could take a look at how it's explained in the airbnb guide which is pretty much the most popular JS style guide: https://github.com/airbnb/javascript#naming--PascalCase.

  • Custom User Avatar

    Would definitely use spaces, new lines and full variable names. This is not easy to read so not sure why this has been upvoted as a best practice. Clever at most.

  • Custom User Avatar

    Please use spoiler flag next time. Your post was visible in the homepage.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Quite readable? The lack of any new lines and multiple returns on one lie is poor form. I wouldn't approve code like this in merge requests.