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.
duplicate issue above
I used the SUM method wondering if the tests would be vague enough to fall of it. It did... this test could easily be added to catch my sneaky solution.
I also have this message,but I solved it by removing my
console.log
statement.I think -1 existed long before Java. And it's bad but it's consistent with the behavior of
indexOf
in JS. And falsy values in a language with falsy 0 aren't much better in this case (used in PHP for this kind of functions; using==
instead of===
results in a bug)...I did. Done, thanks.
This website is in English only at the moment (I don't see any buttons to change the language, at least), so it makes sense that a kata would be English focused if it isn't specifically targeting some other language.
Also, English's silly ordinal number system makes the kata more challenging. Returning
century + "世紀"
is considerably easier than what you currently have to do.No, it is on purpose: did you see what you should do if the input is not a number?
Please attach your solution and click on "Mark as having spoiler content", I'll help you.
Yes, it's about assertEquals tests. When we talk about expectError it should contain the note about what error/exception is expected. In your case it's non-string argument type.
Message isn't wrong.
Here is some info about typeof operator.
Note that operand should be within the quotes.
But I rewrote this message.
Thanks for feedback!
It means that input argument (HTML color) must be a string.
If it isn't a string then an error should be thrown.
In the previous comments, we talked about medal range in test cases. To seek a robust solution, some unrealistic test cases are necessary.