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.
The kata needs a little precision like: "You can assume that the input string s is always valid and every letter matches a password.".
What if you give a valid string, with extra letters? Maybe part of another test...?
This test has not been thought with the initial idea of discouraging JSON.parse.
This test comes from a real case:
I have a column of type array inside a PostgreSql table. Array's format in Postgre is exactly what we have in the test input.
The best practice, is the one that helps you solving a specific problem efficiently. If JSON.parse can not work here, then the best idea is not using JSON.parse, but to innovate :)
That's exactly my point !!!! This piece of information comes from a man on StackOverflow who agrees about this standard and made his own interpretation depending on his own experience with other developers inside a group. His argument can be valid if you don't have to minify your js file, otherwise it doesn't make any sense like we said (https://stackoverflow.com/questions/22782677/coding-style-in-javascript-why-prefer-2-spaces-not-4-spaces).
If your standard does not give me a solid and unbeatable reason to use it, that means i can have my own, since every solution provided will have its specific standard, or no standard at all.
I understand your point of conforming to standards, what I am trying to say is that, it's not the absolute way to do it.
That's an excellent idea, thanks.
Thanks, changed. In the future, I will do myself every kata i create, like a real user.
Interesting result, but question, why did you use eval in this situation, instead of a function?
There is only one point I agree with you is 0 spaces at the beginning, it was a copy/paste from one my file (BAD). But about your 2 spaces, the main reason this standard has been fixed is to save 4% on the file size, which does not make sense here.
You can use 4, 2 spaces or tabs, there are no best way to do it. Even some languages like php recommends 4 spaces and no tabs. It only depends on your personal preference, and I prefer 4 spaces.
Thank you for the suggestions :)
You are right, my mistake as it is my first kata, I just changed the initial code to be the barebone structure of the function.