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
This comment is hidden because it contains spoiler information about the solution
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.
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.
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.
Duplicate issue
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.
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.
Please use spoiler flag next time. Your post was visible in the homepage.
This comment is hidden because it contains spoiler information about the solution
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.