Here is the array I am working with:
var data = [
{"firstname":"A","middlename":"B","lastname":"C"},
{"firstname":"L","middlename":"M","lastname":"N"},
{"firstname":"X","middlename":"Y","lastname":"Z"}
];
I need to update the values for all keys - firstname, middlename, and lastname in this array.
var updatedData = [];
angular.forEach(data, function(item, key) {
modifiedValues = {};
angular.forEach(item, function(value, key1) {
var newValue = value + "constant";
modifiedValues[key1] = newValue;
});
updatedData.push(modifiedValues);
});
Any assistance on this task would be greatly appreciated. Thank you in advance.