vendredi 22 décembre 2017

Convert Array of Objects into Object containing key and value as Array of Objects

I am getting a response as Array of Objects

Array [Object, Object, Object, Object]

I want to convert it into an Object with some key and value as above Array of Objects

Object {someKey : Array[4]}

I am trying to do it like:

var someKeys = Object.map(a => a.arr_key); 

Object[someKeys[0]] = Object;

but failing, need some help here. Thank you!!




Aucun commentaire:

Enregistrer un commentaire