It seems duplicated question, but I could not find ideal way to solve it. (I searched on google about the keyword like 'convert array of object'... Yes! I'm stupid...)
My current data is like this.
[ { name: 'apple', value: 'red' },
{ name: 'banana', value: 'yellow' },
{ name: 'ocean', value: 'blue'}
]
And, I want to change it to object like this.
[ { 'apple' : 'red' }, { 'banana' : 'yellow' }, { 'ocean' : 'blue' } ]
Thanks in advance!