What is the correct way to check if a person is older than 18 years in JavaScript?

How to validate that user is 18 or older from date of birth? Based on the user birthday input we can calculate in JavaScript is this user 18 or older by using this function: function underAgeValidate(birthday){ // it will accept two types of format yyyy-mm-dd and yyyy/mm/dd var optimizedBirthday = birthday.

Sizin İçin Seçtik  How do you find age in Java?

Leave a Reply

Your email address will not be published. Required fields are marked *