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
i.e.,
RegExp.prototype.test
is not a pure function: it modifies itsthis
. It's documented, but I'm unsure it's a good thing ( this of course really means I think it's not ).And as you put it "can be approached differently" :)
Since it is not possible to find some good, hard measures of what "good code" is - all submissions that run the test suite are pr. definition "good". Though, I admit, some entries are on the edge.
But even the edge solutions are of value. Some people are very good at finding the shortest route to getting through the test cases - so when writing kata test cases you are forced to be very particular which will highten your awareness of what can be bypassed.
So, in all - every submission has a value - depending on your perspective, you can learn from each (unless it's very similar to your own solution, that is :))
JavaScript allow for unicode characters in identifiers - even written as \uNNNN.
Essentially this solution is a cheat which you will see when you 'translate' the uni code characters following the assignment (first line).