data.map(obj =>
{person_name: obj.user.name,
...obj})
Why above code failed?
my data look like this
[{user:{name:'hello'},age:1},{user:{name:'world'},age:1,{user:{name:'another_name'},age:1]
I want to 'pull' the obj.user.name out from the nested obj.
...objdoing? please add the wanted result as well....is a punctuator used in a number of different contexts (e.g. spread element, assignment rest element), it's not an operator.