I have an array of objects like this:
[
{id: 'id1', random: 'labels.prop1'},
{id: 'id2', random: 'labels.prop2'},
{id: 'id3', random: 'texts.anotherprop'}
]
Is there a short way to generate from that array an object based on the property random? I'd need this:
{
texts: {
anotherprop: ''
},
labels: {
prop1: '',
prop2: ''
}
}