Let's say I have:
let list = [{a: {b: 'foo'}}, {a: {b: 'bar'}}]
I want to end up with:
list = [{a: 'foo'}, {a: 'bar'}]
This works:
list = list.map(d => {d.a = d.a.b; return d})
But I have a bad feeling that changing the value in place is a bad idea.
Is there a cleaner way? is my solution actually valid?