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.
Can you share what worked? I can't get this test to pass either. I feel like I'm building an empty list improperly, but I have no idea what an empty list should look like, and I can't get "toArray" to work.
I tried that, but the test says
TypeError: Cannot call method 'toArray' of null
at Test.it
at Test.describe
If I use Cons(null, null) I get this error:
TypeError: Cannot call method 'toArray' of undefined
at Test.it
at Test.describe
I'm getting a "Test Didn't Pass: Unknown Error" whenever I try to run my tests. Even with blank tests, and not altering the starting code at all. Doesn't seem like that should happen. :/
Any reason you wouldn't want to throw the needed methods into a constant array (like in my solution)? That way, it doesn't create that array every time you call the method ...
I think the initial value is 0 by default, so don't think we need that here?
Also, I think I would have a return true if coords.empty? so that it doesn't try to do that expensive exponent function in that case ...