Create a function that prints the current date and time.
const getDate = () => {
const date = new Date()
console.log(date)
const date = new Date()
console.log(date)
return date;
}
getDate();
> Fri Apr 12 2024 10:44:38 GMT+0100 (West Africa Standard Time)