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.
If did that, than you should be proud of yourself. Constructing a algorithm to treat string dates ins't something trivial.
This is my first time to use Date.parse(),I learned more!
While this is true, the input for this particular kata is already standardized to the "June 15, 2014" form. This particular form is pretty much interpreted exactly the same in all implementations.
This is a "Clever" solution that fits the general case.
Very clever !!
I feel slightly embarrassed of my solution now haha. Well done!
Date.parse is very convenient. Nice solution.
It is so clean! It is awesome!
It is a awesome solution. But please try this "checkCoupon('123','123','September 5, 20','October 1, 2000')".
It will not pass.
This is also how I solved it. Sadly, I didn't realize that Date.parse() was frowned upon.
Awesome solution. But it seems that Mozilla Foundation does not recommend the use of Data.parse() anymore, as seen here https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse
"It is not recommended to use Date.parse as until ES5, parsing of strings was entirely implementation dependent. There are still many differences in how different hosts parse date strings, therefore date strings should be manually parsed (a library can help if many different formats are to be accommodated)."
Infinitely simpler than what I did... Basically the same thing, but it never occurred me to simplify it that much >_<
Same, I also did a chunky and ugly looking loop that checks against a list of month names haha... it looks like a disgrace next to this solution. But that's what's so cool about codewars! You're learning new practices all the time :)