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.
Nice.
Regarding
var result = 0;
You can just declare result variable. IMHO this is better option for readability of your code.
var result;
Or you can initialize it to default value and loose else block.
var result = null;
You could improve formatting. Solution from slaven.m is example of good formatting.
This part of code will never be executed. Can you think of why?