I fail miserably at combining all the required transformations. For those more at ease with data manipulation, a little help will be much appreciated, thank you.
Visual representation of what I'm trying to accomplish:
[
[
{
name : 'a',
value : 'b'
},
{
name : 'c',
value : 'd'
},
...
],
[
{
name : 'e',
value : 'f'
},
{
name : 'g',
value : 'h'
},
...
],
...
]
// to
[
{
a : 'b',
c : 'd'
},
{
e : 'f',
g : 'h'
},
...
]
banddas values for both sets of keys. You seem to have lostfandh. Is this a typo or is it the desired behavior? The second note is that what you're showing is not valid JSON. JSON requires that keys and values be quoted in double quotes", not single quotes'.return arr.map(function(els){return els.reduce(function(m,el){m[el.name]=el.value;return m;},{});})- hardly helpful for you.