In my Vuejs below I want to filter the reviewed:true only questions, and get the length of them, but my code below gives an error TypeError: question.reviewed.includes is not a function ,is there a way to do it?
Here is the screenshot about the json file: JSON File
filterReviewed() {
return this.questions.filter((question) => {
return (
question.reviewed
.includes('true')
);
});
},
reviewedis a property ofquestion.return this.questions.filter((question) => question.reviewed). No need forincludes.return this.questions.filter((question) => question.reviewed)