Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

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

Felix 70

@felix-toledo

Desktop design screenshot for the Age calculator app coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
2junior
View challenge

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

@JAleXDesigN

Posted

Hi Felix, since you are re-assigning values to those variables you can use let instead of var

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

1

Please log in to post a comment

Log in with GitHub
Discord logo

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