// Create a new Date object for the desired dateconst targetDate = newDate('2022-12-31');
// Get the current dateconst currentDate = newDate();
// Check if the target date is in the pastif (targetDate < currentDate) {
console.log('The target date is in the past');
} else {
console.log('The target date is in the future');
}