Not just converting from array to object in javascript, I want to omit the specific fields and convert them into the object.
Here is my input data.
taggedItems = [
{id:0, left:100, top:100, thumbSize:100, image: 'b', url: 'y'},
{id:1, left:150, top:150, thumbSize:100, image: 'd', url: 'x'},
{id:2, left:200, top:200, thumbSize:100, image: 'f', url: 'w'},
]
Here expected output
taggedOUtput = {
0: {id:0, left:100, top:100, thumbSize:100},
1: {id:1, left:150, top:150, thumbSize:100},
2: {id:2, left:200, top:200, thumbSize:100},
}
How do we conditionally convert Array to object