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.
This comment is hidden because it contains spoiler information about the solution
digital_root(spezial)
toreturn digital_root(spezial)
. You need to return the value and you are simply calling the function. Once the function has been called, there is no statement to return and retain the value; therefore "undefined" is returned (default value).var
before the variablei
. This doesn't effect this code, but makes the variable global which may affect your coding in the future if you don't include it (I've seen bugs before because of the lack of it).This comment is hidden because it contains spoiler information about the solution
I'm quite confused by your comment. You might be using the coding structure wrong? You don't have to implement testcases since the Kata already has inbuilt testcases.
Mind if you post your code to this reply so I can see what's happening?
I did it in JavaScript. Log is always correct, Default Test passed and Value 0 passed too. Other results are undefined? Tried with assertEquals and assertSimilar. If result is more than one digit I call function digital_root again with new value until single digit. Works well at home but cannot attempt in kata. Why???