What is the best way to convert:
Dynamically I am getting an array.
For example we can consider this following array.
[
'typeRead_1',
'typeModify_1',
'typeModify_2',
'typeRead_3',
];
But I want it something like this. to:
{
1: {
typeRead: true,
typeModify: true,
},
2: {
typeRead: false,
typeModify: true,
},
3: {
typeRead: true,
typeModify: false,
}
};