I am having a hard time figuring this out :(
I have an array of dates:
let myDatesArray = [
"Sun Oct 01 2017 05:30:00 GMT+0530 (IST)",
"Mon Oct 02 2017 05:30:00 GMT+0530 (IST)",
"Mon Oct 02 2017 06:30:00 GMT+0530 (IST)",
"Tue Oct 03 2017 05:30:00 GMT+0530 (IST)",
"Wed Oct 04 2017 05:30:00 GMT+0530 (IST)",
"Thu Oct 05 2017 05:30:00 GMT+0530 (IST)",
"Fri Oct 06 2017 05:30:00 GMT+0530 (IST)",
"Sat Oct 07 2017 05:30:00 GMT+0530 (IST)"]
However, I am only allowed to have one date entry per day! The array can have TWO dates for Monday, October 2nd but I would have to discard one (hence one per day). I tried using myDatesArray.filter(el => ????)
but can't figure it out. Any ideas on how I could achieve this?