Age calculator app using HTML, CSS, and vanilla Javascript

Solution retrospective
When I was making the design for the mobile version many times the horizontal line was hidden when the screen size was reduced to mobile. So any suggestion on that part would be very helpful if there is a better way to do so. Also, I am unsure about the javascript logic that I have used because it's a very brute-force method that I have used. I am not sure if it is the best way to calculate the age. Other than these any suggestions would be very helpful regarding any mistakes that I have done or any best practices that I should have followed.
Please log in to post a comment
Log in with GitHubCommunity feedback
- @0xabdulkhaliq
Hello there 👋. Congratulations on successfully completing the challenge! 🎉
- I have other recommendations regarding your code that I believe will be of great interest to you.
JAVASCRIPT 🟡:
- The way you declared variables are need to be well structured and organized
- Take a look at the following example code which describes a better way of declaring variables to have a well structured code
const firstName = "Your"; const lastName = "Name"; const emailAddress = "example@some.com"; const password = "supersecret";
- instead try this,
const firstName = "Your", lastName = "Name", emailAddress = "example@some.com" ••• ••• // n number of declarations password = "supersecret"; // make sure to add a semicolon at end of last declaration
- This single line declaration with separated commas will helps you to have a better structured code and improves readability though
I hope you find this helpful 😄 Above all, the solution you submitted is great !
Happy coding!
Marked as helpful - @Danish49
nicely done
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