Received a JSON response from an API service:
data = [{
id: 'event-1',
title: 'All Day Event',
start: '-01T14:30:00',
end: '-02T14:30:00',
className: "bg-danger",
description: 'Aenean fermentum quam vel sapien rutrum cursus. Vestibulum imperdiet finibus odio, nec tincidunt felis facilisis eu. '
},
{
id: 'event-2',
title: 'kiniko',
start: '-01T14:30:00',
end: '-02T14:30:00',
className: "bg-success",
description: 'Vestibulum imperdiet finibus odio, '
},
.....
];
Need help converting the array into individual objects:
Example shown below:
convertedObject = {
id: 'event-1',
title: 'All Day Event',
start: '-01T14:30:00',
end: '-02T14:30:00',
className: "bg-danger",
description: 'Aenean fermentum quam vel sapien rutrum cursus. Vestibulum imperdiet finibus odio, nec tincidunt felis facilisis eu. '
},
{
id: 'event-2',
title: 'kiniko',
start: '-01T14:30:00',
end: '-02T14:30:00',
className: "bg-success",
description: 'Vestibulum imperdiet finibus odio, '
}
....
;
The convertedObject should have only object {} without the [] array.
Appreciate your assistance!