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
Cluttering
String.prototype
with helper functions really isn't good practice either. No sense in cluttering the global scope either. Best practice would probably be to create a function within the scope ofisAnagram
, since it'll only be needed by it. Although, there's really nothing wrong with just repeating the string operation. It's not a complex enough operation to make outsourcing it absolutely necessary.I agree with you about the ternary operator, though.
a == b ? true : false
is probably one of the dumbest anti-patterns ever.