I have an array of object that is need to create a filter on. The list contains an owner_id property in the JSON...
At the moment im just looping all in the array, however the list should NOT take the ones where owner_id is equal to one of the values in my filterarray:
var filter = "[14657612, 2215375794]";
$.ajax({
url: 'myEndPOint',
dataType: 'json',
success: function(data) {
var media = data.media;
var arr = [];
_.filter(media, function(val){
//The magic should happen here, only return items that has'nt got an val.owner_id that is in "filter" array
});
for(i=0; i < media.length; i++) {
var thumb = media[i].thumbnail;
var html = "<li><img src=" + thumb + " /></li>";
arr.push(html);
}
$(".social-ribbon-target").append(arr);
$(".loading").css("display", "none");*/
},
error: function(error) {
console.log("error");
}
});