I am currently facing an issue and seeking feedback on how to resolve it.
Below is the JSON data:
questions: [
{
question: 'lala',
answer: 'papa',
categories: ['Handla']
},
{
question: 'xxxx',
answer: 'yyyy',
categories: ['Reklamation']
},
{
question: 'abcefg',
answer: 'gooooogle',
categories: ['Reklamation']
}
]
My objective is to loop through this question array, extract and append ALL the object.categories to a new array, and then eliminate any duplicate entries. So, the desired output should be:
["Handla", "Reklamation"]