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 right. I corrected this mistake and all JS tests passed. Thank you for your help.
You're using the built-in function in line 2 incorrectly.
Thank you for your answer. I guess there is something wrong with my JS solution then.
Both seem fine to me. I just passed on both with very similar solutions.
All random test failed for solution in JavaScript. Submitted the same solution in Ruby, all tests passed. Is there a problem with JavaScript random tests?
It would probably be better to do a null check before a length check (
arr == null || arr.length == 0
), if the order is reversed, null check becomes redundant.I guess that checking for a for-each-loop use in a solution means checking for an
iterator
method call. So maybe you can extendArrayList
(or other implementation to be used as a fn parameter) and overrideiterator
method. Like that:Maybe do the same for some other methods (
get
for example).