i am trying to return all elements matching authorize === Administrator or authorize === Visitor without success
hier ist what i have sofar. Jsfiddle
var otherStuff = {};
courses = [
{ index: ['', 'overview'], moduleId: 'overview', title: 'overview', nav: 1 , authorize: ["sellers", "taxi"]},
{ index: 'rating', moduleId: 'rating', title: 'rating', nav: 3},
{ index: 'example', moduleId: 'example', title: 'example', nav: 5, authorize: ["Visitor", "Administrator"] },
{ index: 'apple', moduleId: 'apple', title: 'apple', nav: 6, authorize: ["User", "Administrator"] },
]
var resultSet = $.grep(courses, function (element, index) {
// return all element with authorize === Administrator or authorize === Visitor;
});
console.log(JSON.stringify(resultSet))
can anyone help me on that ?