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.
The kata aka specification states that a boolean is given, so in real life an error should be raised. However, kind of exception handling is out of scope of kata imHo.
Therefore, the solution is fine.
Author might have Javascript background where such abominations are used because of JS' implicit type conversions.
Please don't demand some formatted string as result (except when that's what the kata is about). Let people build native data structures.