I want to reduce object array which is as below:
arr=[{title: 'AP', CurrentDate: 2019-07-31, Status: 'done', NoOfEvents:'6' }]
Now I want to reduce this array object to get NoOfEvents value.
So I am trying below code but it's not working:
arr.reduce((n,x) => n + (x.title === 'AP' && new Date(x.CurrentDate) > (2019-05-15) + x.NoOfEvents,null)
How do I get value of NoOfEvents based on above condition in reduce?
NoOfEventsvalue based on condition