The data I am receiving from the backend is in an array object format. How can I transform it into a particular data format? For example:
data = [
{ name: value, age: value, phoneNumber: value, email: value },
{ name: value, age: value, phoneNumber: value, email: value },
{ name: value, age: value, phoneNumber: value, email: value },
]
I would like to convert this data into the following format:
data = {
person: [
{ name: value, email: value },
{ name: value, email: value },
{ name: value, email: value },
],
}