I am currently working with an array structured like this :
array = ['2020-06-03', '2020-06-05', '2020-06-06']
My task is to transform it into the following format :
Object {
"2020-06-03": Object {
"selected": true,
"selectedColor": "#ff5555",
},
"2020-06-04": Object {
"selected": true,
"selectedColor": "#ff5555",
},
"2020-06-05": Object {
"selected": true,
"selectedColor": "#ff5555",
},
}
This is my current approach :
const historyDates = map(date => {
return { selected: true, selectedColor: "#ff5555"};
}, array);
The issue I am facing is that I need to include keys in the new object created. How can I achieve this using Ramda expressions? Additionally, I am aware that I am returning a mapped array instead of an object filled with sub-objects.
Any assistance or guidance would be greatly appreciated.