i'm attempting to compare the current date to an object array. like below. i need the current date value to show in the format: "February 20, 2020" below is my code.
let rightNow = new Date();
const dd = rightNow.getDate();
const mm = rightNow.getMonth()+1;
const year = rightNow.getFullYear();
let rightNowActual = dd + '' + mm + '' + year;
console.log(rightNowActual);
i need to compare rightNowActual to the object dates below
const events2020v2 = [
{event:"EventName1", Dates:'March 07, 2020'},
{event:"EventName2", Dates:'March 29, 2020'},
{event:"EventName3", Dates:'May 02, 2020'},
{event:"EventName4", Dates:'May 31, 2020'},
{event:"EventName5", Dates:'June 07, 2020'},
{event:"EventName6", Dates:'February 20, 2020'},
];
this is so i can write an if statement when there is a match. like
if(rightNowActual = [some event date]){do something
} else {do something else }