Here is some sample data:
{
"id": 1,
"title": "Title one",
"category_data": {
"2": "Team",
"7": "Queries"
}
},
A function is used to remove duplicate categories from the data:
remove_category_duplicates: function () {
// Get all categories and remove duplicates
let data = {}
this.info.forEach(i=>{
Object.assign(data,i.category_data);
})
return data;
},
The function returns an object with unique categories:
Object {
12: "Fax",
2: "Team",
6: "Questions",
7: "Queries"
}
Is there a way to extract and return just the value (e.g., Fax) as well? The intention is to then store these name values in an array.
Appreciate any guidance, thank you.