samedi 22 février 2020

How to convert array with objects to one object like Laravel Request object

I have an array like this:

[{FirstName: "fff"},
{LastName: null},
{Nationality: null},
{Year: null},
{Month: null},
{Day: null}]

I need to convert it to one object like this: (with Laravel or with JS)

{FirstName: "fff",
LastName: null,
Nationality: null,
Year: null,
Month: null,
Day: null}

I need one object exactly like Laravel request object. How can I do this?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire