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.
Exactly as AcesOfGlory said: In your solution is no check for null.
Btw:
With 3 ` at the beginning and at the end of a code block, you can give it a better visualisation.
Change the order of your null check. Since code executes from left to right, the null value will be checked if it has a length less than 2 then it will check if it is a null. However, you want to check if it is a null first since a null value can't have a length and therefore fails the first bit of the null check.
Change it to
if (numbers == null || numbers.length < 2)
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Kata is way too easy for 6 kyu. Took me less than 30 seconds to type out the solution and I wouldn't consider myself a seasoned programmer... :)
Agreed with this. There are some 6kyu that I have trouble solving and this one took me about 5 minutes and that's with me looking up methods as I am just starting to learn JavaScript.