title: How to calculate age in JavaScript with the format dd/mm/yyyy?
body: <p>How to take user input in the dd/mm/yyyy format and use it to calculate the user's age?</p>
  
  <pre><code>function userAge() {
    var todayDate = new Date().getMilliseconds;
    var birthDateSplit = document.getElementById("birthDate").split('/');
    var birthDate = new Date(birthDateSplit[2],birthDateSplit[1],birthDateSplit[0]);
    var day = birthDate[2]*86400000;
    var month = birthDate[1]*2629746000;
    var year = birthDate[0]*31556952000;
    var age = today - (day + month + year);
  
    return age;
  }
  </code></pre>