Is it my syntax, or is what I'm trying to do just completely the wrong way of going about this?
I have two arrays that are populated by whatever attributes the user selects. Then I'm trying to use $.grep() on a json file to select pillows that match their search. So in the example below, I'm trying to find all pillows with a "down" fill and a "low" price.
var activevars = ['fill','price'];
var activeattributes = ['down','low'];
pillowSelection = $.grep(data.pillow, function (a) {
return $.inArray(a[activevars], activeattributes) > -1;
});
I'm a tenacious Googler, but this has me stumped. Thanks so much in advance for any clues.