in my vue js code below i have questions came from API with their categories all saved in questions array, what i want to achieve is when any of those categories clicked it should filter the questions that related to those categories only, but in my code it shows only single question with its category... like it's not showing all related questions with that clicked category .. any help please?
selectedAnswer(index) {
this.selectedIndex = index;
this.questions = this.questions.filter((question) =>
question.categories.includes(index)
);
console.log(index);
},