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 will also fail if there are ten total subversion numbers or more, e.g.
[9, 10].sort() => [10, 9]
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
I used 4 regex expressions to get to this result (and upvoted similar answers). But after reading the explanation, I now understand I should have used this. Thanks for taking the time to break it down.
Thanx mate!
Good question. Just a lack of familiarity with Javascript. I see also that I left a debugging line in there as well.
jsperf shows Math.max is considerably faster:
http://jsperf.com/max-vs-sort-performance