Get a person's age by birthday
Quickstart:
<script src="mysmx-getage.js"></script> <script> let birthdateParts = '10-31-1980'.split('-'), birthdate = new Date(Date.UTC(birthdateParts[2], birthdateParts[0] - 1, birthdateParts[1], 0, 0, 0)); console.log('age:'+getAge(birthdate)); </script>