Design comparison
Solution retrospective
I would like to know if there are any parts of my code (particularly the JS) that I could improve on. Are there any best practices I have missed or ways to make my code more readable / efficient?
Thank you!
Community feedback
- @arberlisajPosted over 1 year ago
Hi @danielle I would like to congratulate you on completing the Age Calculator App and I might have a couple quick solutions for your questions
- Instead of declaring constant variables like this:
const dayLabel = day;
const monthLabel = month;
etc. You want to declare them like thisconst dayLabel = day , monthLabel = month , yearLabel = year;
- I see you use function keyword inside methods for an instance
forEach(function(monthOfYear)
it would've been a lot better if you used arrow like thismonthsOfYear.forEach(m=> if(m.month === selectedMonth) // return something)
All in all good solution and it would be a lot better if you remove the designe directory from you github repo as it is just a liability and it takes space for no good purpose
Happy Coding :)
Marked as helpful1@dfeeney96Posted over 1 year agoThank you for your feedback @arberLisaj ! Some great points
1 - Instead of declaring constant variables like this:
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