Skip to content
  • Learning paths
  • Challenges
  • Solutions
  • Articles
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted about 1 year ago

Age calculator app solution using HTML, CSS, and JavaScript

Adam Rafferty•20
@adraf
A solution to the Age calculator app challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


What are you most proud of, and what would you do differently next time?

Having a fully running app that works and managed to get all the bugs and tweaks I could think of and that I ran into in user testing. I think my large if...else statement that makes up the bulk of the JavaScript functionality and adds in the error messages could probably be smaller and refactored again.

What challenges did you encounter, and how did you overcome them?

One of my challenges was when I began adding in my own error messages to alert the user to issues, as the system generated 'max' attribute in the HTML was overriding what I was trying to achieve and also some rules in different parts of the code were affecting the outcomes as well. This is where I then made big changes and refactored the code into one large if...else statement to make sure there were no clashes and everything ran in order. The 'max' attributes were all removed from the HTML and I also added in the disabling of the submit button until all the rules had been met, and any necessary changes had been made by the user.

From previous projects I've found taking regular breaks is always helpful. Also with this particular issue I wrote everything out on a sheet of paper to set up the if...else pathway.

What specific areas of your project would you like help with?

Any feedback is welcome I think there's probably a way to have written a lot less code that I've missed so that would be great to hear about if so.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on Adam Rafferty's solution.

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord
Frontend Mentor logo

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub