Q:

how can I assign names to Array data on MongoDB when I render it on React?

I have MongoDB 
"location" : [ 
    -34.5782531, 
    -58.4250269
],

Which is like this.
However, when I render this on React. I want to assign names to the array data which is like below. 
    "location" : [ 
    "lat" : -34.5782531, 
    "lng" : -58.4250269
],

In order to display this coordinate on google-map-react.

A:

If you know that's not going to change, then it could be as easy as:
const data = [{ lat: location[0], lng: location[1] }]

Just creating a new array with an object inside.

