I start with multi-dimensional array like so:
[
['prop1', 'prop2', 'prop3', 'prop3'],
['val1', 'val2', 'val3', 'val4']
]
I need to transform this in an object like this one:
{ prop1: 'val1',
prop2: 'val2',
prop3: ['val3', 'val4']
}
Normally I could use _.object(array[0], array[1]) to solve this but the presence of the duplicate key prop3 complicates things quite a bit;
Actual _.object will set prop3: 'val4', erasing val3
Anyone got an idea on how I could achieve the results presented above?
Thank you