Great, that's it. Thanks a lot! The indexOf is just an example. The options are actually some kind of filters and I want to check each item against each filter. Depending on the filter It could be indexOf.
On 21 Feb., 14:44, Mike <mal...@gmail.com> wrote: > > What is "key"? That's not in either one of your data structs. > > Oops, sorry, didn't look closely enough. But you can't use 'key' that > way. Try this: > > if (item[key].indexOf(options[key]) != -1) > > Not sure what you're after with the indexOf though.