Age Calculator App With Vite, React, CSS. Deploy Vercel.

Solution retrospective
Hope its Ok. The unic problem that I think i've found was that I've heard is not a "good practice" to use var. But when I calculate the age, I can't found a way to do it without var.
var newAge = actualYear - dateToCalculate[2] var newMonth = 0 var newDay = 0
Those lines are in App.jsx
Please log in to post a comment
Log in with GitHubCommunity feedback
- @JAleXDesigN
Hi Felix, since you are re-assigning values to those variables you can use
let
instead ofvar
let newAge = actualYear - dateToCalculate[2] let newMonth = 0 let newDay = 0
In this way the code would work the same and you would not use var.
Marked as helpful
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