Create a Date object and alert the current date and time. code example
Example 1: new date parameters javascript
// new Date parameters in javascript
new Date(year, month, date, hours, minutes, seconds, ms)
Example 2: new date javascript
/*Get date from JS API - Date() class*/
let local_date = new Date();
alert("it is " + local_date + "!")