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.
I guess this is a way to protect the original array from modification.
I feel really dumb. That should have been obvious.
Thanks for the Kata and the follow up.
Your code returns "0" for the case of "0/0" instead of throwing the error. That's the problem. Yes, it throws the error on the next case, "3/0", and that case gets passed. But the previous case, "0/0", does not throw the error. Fix this.
Also, a screenshot of this code running the examples http://imgur.com/531jQ5R
This comment is hidden because it contains spoiler information about the solution
Please show me your code here (just mark it as spoiler). Throwing any error should actually work fine.
Really appriciate this Kata. It was very interesting.
Using Javascript I can't get the solution to validate a thrown error.
throw "ZeroDivisionError";
results in: Expected error was thrown: ZeroDivisionError
...but no passing checkmark. I've tried everything up to crafting a custom Error Type called ZeroDivisionError and throwing it. The log seems to detect the error was thrown but nothing passes.
Just raise any exception in JavaScript, it will work.
throw "ZeroDivisionError";
should work fine.