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 think a for loop is indeed better that a while loop, as you do the definition of the counter variable and the incrementation in one line :)
Really a clever solution! :)
No one dose!
Great solution, runeh.
You can also ignore the Math.abs() function as in the match[1] and match[2] is just the "remembered" part of the expression and this is the number before the optional "." without the "-".
Hmm, I do not understand how to start this.
...
Why is there the "||9"?
Edit: Ok, now I know. It's when digits of the birtdate calculate to "9".
Awesome. I was not aware that you can have the sum of the digits by doing modulo 9 operation.
Anyone knows why is that?
This comment is hidden because it contains spoiler information about the solution
I found a nice way to convert a float into an int:
var intVal = floatVal | 0;
You can find it here: http://stackoverflow.com/questions/596467/how-do-i-convert-a-float-to-an-int-in-javascript
Also:
What happens when startDate is in 1969?
I tried "endDate.getTime()-startDate.getTime()/1000 | 0 and it worked :)