Looking to populate the centreValues array with values from another array
const centreValues=[
{
title:'Type',
value:centreDetail.location_type
},
{
title:'Address',
value:centreDetail.address1+centreDetail.address2
},
{
title:'City',
value:centreDetail.city
},
{
title:'State/Province',
value:centreDetail.state
},
{
title:'Postal/Zipcode',
value:centreDetail.zip
},
{
title:'Phone',
value:centreDetail.phone
},
]
The structure of my centreDetails JSON object is:
centreDetails={
location_type:'some Value',
address1: 'some Value',
address2:'some Value',
....
}
How can I substitute these values into the centreValues array?