I am having trouble converting an array of objects into an object of objects for my job. The company API is expecting the data in this format. Any help would be appreciated. Here is an example
Original
const array = [
{
type: 'ITEM',
info: {
item_id: 'house'
}
},
{
type: 'ITEM',
info: {
item_id: 'house'
}
}
]
Final
const array = {
{
type: 'ITEM',
info: {
item_id: 'house'
}
},
{
type: 'ITEM',
info: {
item_id: 'house'
}
}
}