Hi I would like to find a condition in jquery to be sure that the id of the data found by .grep is different from all the values from a vector, with something like this :
var matchedAgainstBrand = $.grep(prodata, function(v,i) {
return v['id'] !== matchedProIds ;
});
or this
var matchedAgainstBrand = $.grep(prodata, function(v,i) {
return $.inArray( v['id'], matchedProIds ) == -1;
});
(but these two do not work !)
where matchedProIds is a vector of integers, defined like this :
var matchedProIds = [];
for (i=0; i< matchedPro.length; i++) {
matchedProIds.push(matchedPro[i]['id']);
}
Can you help with a condition that (un)match a value against a vector ?