I am looking to filter out records that have a year between 2000 to 2021.
"Rank": 50,
"Title": "Casablanca",
"Description": "A cynical nightclub owner protects an old flame and her husband from Nazis in Morocco.",
"Runtime": 102,
"Genre": "Drama",
"Rating": 8.5,
"Metascore": "100",
"Votes": 441864,
"Gross_Earning_in_Mil": "1.02",
"Director": "Michael Curtiz",
"Actor": "Humphrey Bogart",
"Year": 1942
I have tried using a method I found from a different solution however it does not work correctly.
var startDate = new Date("1990");
var endDate = new Date("2000");
var resultProductData = movies.filter(a => {
var date = new Date(a.Year);
return (date >= startDate && date <= endDate);
});