I have a very long object of dates, which pairs a date with a price/number. For example:
let obj = {
"2022-09-17": 45,
"2022-09-18": 35,
"2022-09-19": 34,
"2022-09-20": 26,
"2022-09-21": 25,
"2022-09-22": 33,
"2022-09-23": 56,
"2022-09-24": 39,
"2022-09-25": 49,
"2022-09-26": 25,
"2022-09-27": 25,
"2022-09-28": 25,
"2022-09-29": 33,
"2022-09-30": 42,
"2022-10-01": 28,
"2022-10-02": 38,
"2022-10-03": 35,
"2022-10-04": 25,
"2022-10-05": 25,
"2022-10-06": 31
}
What is the best way to regroup this object as an array of months, which correlate to the dates and contain the key/values?
Eg - like this screenshot:
I want to group the key/value pair by months, so I can later, then loop through all months, to find the lowest price of each month.
But first, I wanted to figure out the best way to break up this object, in months?
Thanks,
