Here is an example of an array containing objects:
array = [
{prop1: 'teste1', prop2: 'value1', prop3: 'anotherValue1' },
{prop1: 'teste2', prop2: 'value2', prop3: 'anotherValue2' },
{prop1: 'teste3', prop2: 'value3', prop3: 'anotherValue3' }
]
I am looking to transform this array into a new format like below:
[
{prop1:['teste1', 'teste2', 'teste3']},
{prop2:['value1', 'value2', 'value3']},
{prop3:['anotherValue1', 'anotherValue2', 'anotherValue3']}
]