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.
Initial Solution Setup:
I don't think overwriting its own function is a good practice.
b=0
should result inNaN
, notundefined
. That's how modulo works everywhere.Needs a static test case for
a
andb
having a different sign and the expected modulo being zero.The random tests do not always catch this scenario, and it's a possible failure mode for a certain naive solution.