Let's say I have an array like so:
[
{
field: "firstname",
value: "John"
},
{
field: "lastname",
value: "Doe"
},
{
field: "hobbies",
value: "singing, basketball"
},
]
Now I want to convert it into an object like so where in the key is the field
and the value is the value
from the above array:
const result = {
firstname: "John",
lastname: "Doe",
hobbies: "Singing, basketball"
}