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