I have this array of objects
var list = [{
"questionId": 1,
"correctChoiceIds": [],
"choiceId": 0,
"number": 1
}, {
"questionId": 1,
"correctChoiceIds": [1234, 4567],
"choiceId": 0,
"number": 2,
}, {
"questionId": 2,
"correctChoiceIds": [],
"choiceId": 0,
"number": 3
}];
//This filter gives me an array with list[0] and list[1]
var filterQuestion = $filter('filter')(list, { questionId: 1 }, true);
I want to filter all those with an empty array for their correctChoiceIds.
var filterNoCorrectChoice= $filter('filter')(list, { correctChoiceIds: [] }, true);
This is what I came up with but it simply gives me nothing. I'm not sure if this is the right way or why it results to nothing.