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.
You're welcome and congrats on solving!
@JPR95 - by the way, since you are new to Codewars, a useful tip for debugging is to print your inputs to console so you can see better what is causing you to fail:
how to print inputs Troubleshooting guide
As @Chrono79 said, you will find that some tests are passing you an input that is indeed "unordered", but you still should be able to create the required "snail" pattern from them (because the "labels" of the elements isn't relevant, only their location in the input array - you could use letters instead of numbers and the kata still makes sense.)
That's a problem with your code, not a kata issue:
There are two fixed tests in javascript, one where the numbers are ordered in the array, similar to the first example, and another similar to the second example. Random tests contain random numbers. You must follow the snail pattern with them too.