Design comparison
Solution retrospective
Any suggestions?
Community feedback
- @AyoubrabiaePosted about 1 year ago
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 usenew 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 helpful1@AnisBachaPosted about 1 year ago@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 GitHubJoin 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