Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Age Calculator - Svelte + Typescript

Huy Phan 1,360

@huyphan2210

Desktop design screenshot for the Age calculator app coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
2junior
View challenge

Design comparison


SolutionDesign

Solution retrospective


Hello😁! My name is Huy, and this is my solution for this challenge.

What I used🚀: HTML, CSS, Typescript, Svelte, Moment.js.

Thank you! Cheers🎉.

Community feedback

@gabrielmorandi

Posted

Hi @huyphan2210, good job completing this challenge!

Your code looks great, and I can see that you put a lot of effort into it. I especially like how you handled the input validation and error cases.

One suggestion I have is to add an event listener to trigger the calculateAge() function whenever the enter key is pressed in one of the input fields. You can do this by modifying your handleFocusOut() function like this:

// Add event listener to trigger calculateAge() on enter key press
e.currentTarget.addEventListener("keydown", (event) => {
  if (event.keyCode === 13) {
    calculateAge();
  }
});

Overall, great work, and keep up the good coding! 😄

Marked as helpful

0

Huy Phan 1,360

@huyphan2210

Posted

@gabrielmorandi Hey! Thank you for checking my code. I really appreciate it. 😁

1

Please log in to post a comment

Log in with GitHub
Discord logo

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