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