Below is my JSON body.
{"key":"OTH","value":{"Name":"Other Countries"}}
I need to add this 'Other Countries' value as a last value in below array 'countryMap'
if (state === "SUCCESS") {
var result = response.getReturnValue();
var countryMap = [];
for(var key in result){
countryMap.push({key: key, value: result[key]});
}
component.set("v.countryList", countryMap);
}
Please help me out on this.
push()
is the function you're looking for.