Submitted over 1 year ago
Age Calculator App With Vite, React, CSS. Deploy Vercel.
@felix-toledo
Design comparison
SolutionDesign
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
Community feedback
- @JAleXDesigNPosted over 1 year ago
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 helpful1
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