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 think this is just missing a few newlines to be perfectly readable production-quality code.
I never decalre them unless they're needed.
You should, but it's not required. This way a function pollutes the global scope, and that's bad.
wow! Don't you have to declare const or let before the function expression name?
good job you are amazing
I also wrote the solution with ternary operators and was really skeptical whether this is the best way and so was seeing the arguments against it. And ya, I think you are right. Clean code looks more elegant than complex, hard-to-read, seemingly-smart-looking-code. I think simple if-else wins here over ternary operator.
This comment is hidden because it contains spoiler information about the solution
In my opinion the test cases should include partial numbers such as "12.test". And/or the test details amended to indicate whether these values should be accepted or return null (I would suggest null).