I need to insert the arrays like locations,commodities into an object which is in this case is refdata. I need to insert the array to object one by one ..as i have done in the code below:-
But i am not getting the desired output.Any help will be appreciated.
var refdata = {
locations: [],
commodities: []
}
var locations=[
{
"symbol": "IND",
"name": "INDIA"
}
]
var commodities= [
{
"name": "Aluminium",
"symbol": "AL"
}
]
this.refdata={locations};
this.refdta={commodities};
console.log(this.refdata)