i got an object with arrays that gives this output (the input is from a series of forms with group-names) :
{
username: [ 'username1', 'username2' ],
firstname: [ 'firstname1', 'firstname2' ],
lastname: [ 'lastname1', 'lastname2' ],
email: [ 'email1', 'email2' ],
}
And I want the object to be formatted like this :
[{username : username1,
firstname : firstname1,
lastname : lastname1,
email : email1},
{username: username2,
firstname: firstname2,
lastname : lastname2,
email : email2}
]
As i'm using node.js, i think there is some method with lodash. Can anyone give me some help? Thank You !
via Ermanno Palmizio Salieri
No comments:
Post a Comment