Q1: My JavaScript does not handle all dates well; there are some issues. How can I solve these issues?"
Donatas Bagužis
@donny333All comments
- @ashwanipydevSubmitted over 1 year ago@donny333Posted over 1 year ago
Hello, @ashwanipydev, You started your code with eventlistener which should call a function. But function is after the event listener. Computer reads code from first row to the last, so it can't find a function (thats my guess :)). Try to move eventlistener after your calculateage function.
Marked as helpful0 - @itsmezainulSubmitted over 1 year ago
any another methods to simplify my code?
@donny333Posted over 1 year agoHello, Very nice and clean code. Just one improvement could be done (not for a code, but overall): when year is in the future it works good. But when I make the same year as now and month or day in the future, there is no error, that date is in the future. So additional validation for the future date would be a good improvement.
Marked as helpful1