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

Responsive design using React js

Anis Bacha 500

@AnisBacha

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


Any suggestions?

Community feedback

@Ayoubrabiae

Posted

Hi Anis Bacha,

I've reviewed your code and the preview, and it's evident that you're doing some fantastic work. However, there's a small issue in your calculation. When I tried to calculate my age, I noticed that it's higher than I expected.

Upon examining your code, I found that you're using new Date().getMonth() to retrieve the month. This is correct, but it's important to note that this function returns the months starting from 0, not 1. For instance, in October, it should return 10, but it actually returns 9. To correct this, you should add 1 to the result you get from it.

Additionally, you're using new Date().getDay() to obtain the day of the month. However, this function returns the day of the week. To get the day of the month, you should use new Date().getDate().

That's all for now. Keep up the great work, and if you need any assistance, I'm here to help. Happy coding!

Marked as helpful

1

Anis Bacha 500

@AnisBacha

Posted

@Ayoubrabiae I didn't notice this issue while working on the challenge, I will implement the necessary adjustments as suggested by you, Thank you for your feedback!

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