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.
Okay, fair enough. Parsing is another level of complexity though. And still, the description and title are there, and they're 100% explanatory about the requirement of using a "while" loop. So not having a test for it, is not an excuse. But that's just how I see it, fine with me if you have a different opinion on that.
But would it be possible to do it from the CodeWars unit tests environment?
That's the title of the kata...
...and that's the first sentence in the task description :) (But maybe the description changed after you posted the solution? Sometimes it happens in CodeWars...)
It's impossible to write a test case veryfing whether you used a loop or not.
That's a clean solution, but has rather high computational complexity for sorting 2 arrays
You could make it even simpler with
Object.values
instead ofObject.keys
and thus avoid[]
accessorsThat's the nicest solution, but the task asked specifically to use a while loop, sooo...