const dateFromData= "06/15/1990" //string type
const formatDate = (dateString: string) => {
const options: Intl.DateTimeFormatOptions = { //Typescript ways of adding the type
year: "numeric",
month: "long",
day: "numeric",
};
return new Date(dateString).toLocaleDateString([], options);
};
console.log(formatDate(dateFromData)); // output will be: June 15, 1990