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.
I did not say that Node v11 was not available when the comment was made, I said it wasnt available when the kata was made, because that is when the kata was given its 7kyu rank. This should be obvious by looking at the top two voted solutions, which are quite convoluted compared to the built-in we have now, but were considered short and elegant back then.
No one slandered him, and I am not saying that people should downvote him, but I am saying that there is a reason that people are doing it.
Node 11 was released 5+ years ago, this comment is only 2 years old.
Other languages exist, but nearly 70% of the solutions are in JS for this kata.
The very word "discourse" means "debate", so sharing an opinion on something shouldn't automatically be slandered and downvoted for no reason (especially when he has a valid point).
Downvote mine too if that makes you/yall happy, have a nice day..
The function you used was first introduced in Node v11, which was not available at the time this kata was created. Also, there do exist other languages besides JS, and in other languages solutions can be more complicated.
And finally, kata ranks usually cannot be changed, so complaining about kata rank in the discourse is not helpful, just annoying. That's probably why they are getting downvotes.
Why people downvoted this comment so much? JS solution could be less than 20 symbols..
This comment is hidden because it contains spoiler information about the solution
Your if condition is wrong. Even when fixing that, your code doesn't check the validity of the digits. Btw,
pin
is already a string.Try passing "-1.234" or "a345" to your function (both should be invalid).