I am trying to create a unique object of years and months based on an array of dates, see what I mean below:

```
const availableDates = ["26-01-2022", "30-01-2022", "02-03-2022", "16-04-2022", "01-01-2023"]; // This list will be really long, just an example

```

I want to create a unique object like below using availableDates but having issues trying to figure it out:

```
const uniqueDates = {
  "2022": ["Jan", "Mar", "Apr"],
  "2023": ["Jan"]
};

```

If you have a better way that I achieve this, please let me know!

Thanks in advance